rails-girls-summer-of-code / rgsoc-teams

Teams management and activity
https://teams.railsgirlssummerofcode.org
MIT License
68 stars 140 forks source link

Hide communications choices #1165

Open tea-n-biccies opened 4 years ago

tea-n-biccies commented 4 years ago

Replace with link to newsletter signup

Montana commented 4 years ago

Hey @tea-n-biccies,

I'll push some code on this within the day.

Montana commented 4 years ago

Hey @tea-n-biccies,

This passes CI. So instead of commenting out the whole communication section, I used a conditional assignment and removed the section itself. Unless there's a reason to keep it, let me know.

Here's the fix:

- if params[:welcome]
  h1 Welcome!

  p Please <strong>check your email address</strong> and fill all required fields to complete signing up.
    Not saving your profile may cause strange behaviour while using the app!
- else
  nav.page
    .back-nav
      ul
        li = icon('chevron-left')
        li = link_to 'Back', @user, class: 'back'
  nav.actions
    ul.list-inline
      li = link_to 'Cancel', @user, class: 'btn btn-default btn-sm'
      li = link_to 'Delete Profile', @user, data: { confirm: 'This action cannot be undone. Are you sure?' }, method: :delete, class: 'btn btn-default btn-sm destroy'

  h1.page-header Edit your profile

  - unless @user.valid?
    .has-error
      .help-block
        p Please fill out all required fields below to complete and verify your profile.

= simple_nested_form_for @user do |f|
  - if @user.errors.any?
    #error_explanation
      h2 = "#{pluralize(@user.errors.count, "error")} prohibited this user from being saved:"
      ul
        - @user.errors.full_messages.each do |message|
          li = message

  = hidden_field_tag :welcome, params[:welcome]
  = hidden_field_tag :redirect_to, params[:redirect_to]

  = f.input :name, wrapper_html: { class: 'col-md-6' }
  = f.input :email, required: true, wrapper_html: { class: 'col-md-6' }
  - if current_user.unconfirmed_email
    .help-block
      p
        ' Check your email on
        = current_user.unconfirmed_email
        '  to confirm your new email address. Until confirmed all messages will go to your current email address.

  = f.input :github_handle, required: false, disabled: true, wrapper_html: { class: 'col-md-6' }
  = f.input :twitter_handle, wrapper_html: { class: 'col-md-6' }
  = f.input :irc_handle, wrapper_html: { class: 'col-md-6' }
  = f.input :homepage, as: :url, wrapper_html: { class: 'col-md-6' }
  = f.input :country, required: true, as: :country, label: "Country", prompt: "Select your country", wrapper_html: { class: 'col-md-6' }
  = f.input :timezone, as: :select, collection: list_all_timezones, label: "Timezone", prompt: "Select your timezone", wrapper_html: { class: 'col-md-6' }
  = f.input :location, required: true, wrapper_html: { class: 'col-md-6' }
  div.clearfix

  = f.input :hide_email, label: 'Never show my email address',  hint: 'Only signed-in users will see your email address anyway. People will have trouble contacting you.'

  = f.input :is_company, label: "I represent a company"

  = f.input :company_name, label: 'Company name'
  = f.input :company_info, label: 'Company info', hint: 'Where is the office, how much space can you provide, etc.'
  = f.input :bio, label: 'About you', hint: 'You can use basic <a href="http://en.wikipedia.org/wiki/Markdown" target="_blank">Markdown</a> here.'.html_safe

  h3.page-header Technologies

  = f.input :tech_expertise_list, placeholder: 'Programming Languages, Frameworks, Technologies, etc. I am experienced with', label: 'Technologies of expertise', hint: 'Separate with comma.'
  = f.input :tech_interest_list, placeholder: 'Other Languages, Technologies, etc. I am interested in', label: 'Technologies of interest', hint: 'Separate with comma.'

  h3.page-header Private information
  p.help-block This information will only be visible to yourself and the organizers.
  = f.input :tshirt_size, as: :select, collection: User::TSHIRT_SIZES.map { |k| [k, k] }, label: 'T-Shirt size', blank: false, required: false, hint: 'For sponsor T-Shirts, in case they send some.'
  = f.input :tshirt_cut, as: :select, collection: User::TSHIRT_CUTS.map { |s| [s, s] }, label: 'T-Shirt cut', include_blank: true
  = f.input :postal_address, hint: "Please give your postal address, including your full name, so we can send things we've received from our sponsors for you :)"

  - if admin?
    h3.page-header Roles
    = f.simple_fields_for :roles do |r|
        = r.input :team_id, as: :select, collection: teams, required: false
        = r.input :name, as: :select, collection: Role::ROLES
        = r.link_to_remove 'Remove', class: 'btn btn-default'
    = f.link_to_add 'Add another role', :roles, class: 'btn btn-primary form-btn-group'

  .actions
    ul.list-inline
      li = f.submit 'Save', class: 'btn btn-success'
      li = link_to 'Cancel', @user, class: 'btn btn-default'

Any problems let me know.

-Montana