From 99be23056e0a4967f377cd1d3ac3878f0a6fe972 Mon Sep 17 00:00:00 2001 From: Godwin Date: Mon, 9 Jan 2017 20:25:23 -0800 Subject: [PATCH] Fixed registration for BBSE2017 --- app/assets/stylesheets/_application.scss | 7 +++++- app/controllers/conferences_controller.rb | 6 ++--- app/helpers/application_helper.rb | 4 ++-- app/views/conferences/_questions.html.haml | 24 +++++++++---------- app/views/conferences/register.html.haml | 2 +- .../registration_confirmation.html.haml | 2 +- .../registration_confirmation.text.haml | 2 +- config/locales/en.yml | 1 + config/locales/es.yml | 1 + 9 files changed, 28 insertions(+), 21 deletions(-) diff --git a/app/assets/stylesheets/_application.scss b/app/assets/stylesheets/_application.scss index aa59619..fb851df 100644 --- a/app/assets/stylesheets/_application.scss +++ b/app/assets/stylesheets/_application.scss @@ -2977,11 +2977,15 @@ a.logo { .conference-details { .links { text-align: center; - font-size: 1.25em; margin-bottom: 2em; .button { margin: 0 0.25em 0.5em; + vertical-align: middle; + } + + .register { + font-size: 1.5em; } } } @@ -3881,6 +3885,7 @@ body.policy .policy-agreement ul { > div { vertical-align: top; + margin-top: 2em; h3, p:first-child { margin-top: 0; diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb index a9d24ec..a372f44 100644 --- a/app/controllers/conferences_controller.rb +++ b/app/controllers/conferences_controller.rb @@ -32,7 +32,7 @@ class ConferencesController < ApplicationController if @this_conference.host? current_user @links ||= [] - @links = [:administrate] + @links = [:administrate, :register] end end end @@ -233,14 +233,14 @@ class ConferencesController < ApplicationController steps ||= registration_steps # make sure we're on a valid step - @register_template ||= (params[:step] || current_step).to_sym + @register_template ||= (params[:step] || view_context.current_step).to_sym if logged_in? && @register_template != :paypal_confirm # if we're logged in if !steps.include?(@register_template) # and we are not viewing a valid step return redirect_to register_path(@this_conference.slug) - elsif @register_template != current_step && !registration_complete? && !@registration.steps_completed.include?(@register_template.to_s) + elsif @register_template != view_context.current_step && !registration_complete? && !@registration.steps_completed.include?(@register_template.to_s) # or the step hasn't been reached, registration is not yet complete, and we're not viewing the latest incomplete step return redirect_to register_path(@this_conference.slug) end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 03427ac..89bf08f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -238,8 +238,8 @@ module ApplicationHelper def registration_steps(conference = @conference) { - pre: [:policy, :basic_info, :workshops], - open: [:policy, :basic_info, :questions, :payment, :workshops] + pre: [:policy, :contact_info, :workshops], + open: [:policy, :contact_info, :questions, :payment, :workshops] }[@this_conference.registration_status] end diff --git a/app/views/conferences/_questions.html.haml b/app/views/conferences/_questions.html.haml index bd932be..dbce807 100644 --- a/app/views/conferences/_questions.html.haml +++ b/app/views/conferences/_questions.html.haml @@ -1,14 +1,14 @@ = columns(medium: 12) do - %p=_'articles.conference_registration.paragraphs.Registration_Info', :p, vars: { city: @this_conference.location.city } + %p=_'articles.conference_registration.paragraphs.Registration_Info', :p, vars: { city: @this_conference.city_name } = form_tag register_path(@this_conference.slug), class: [:centered, :clearfix] do - = columns(medium: 12) do - = radiobuttons :housing, ConferenceRegistration.all_housing_options, @registration.housing, 'articles.conference_registration.questions.housing', heading: 'articles.conference_registration.headings.housing', vertical: true, big: true, inline: true - = fieldset :hosting_dates, heading: 'articles.conference_registration.headings.arrival_and_departure', vars: { city: @this_conference.location.city } do - = selectfield :arrival, @registration.arrival || @this_conference.start_date, conference_days_options_list(:before_plus_one) - = selectfield :departure, @registration.departure || @this_conference.start_date, conference_days_options_list(:after_minus_one) - = radiobuttons :bike, ConferenceRegistration.all_bike_options, @registration.bike, 'articles.conference_registration.questions.bike', heading: 'articles.conference_registration.headings.bike', inline: true, big: true - = radiobuttons :food, ConferenceRegistration.all_food_options, @registration.food, 'articles.conference_registration.questions.food', heading: 'articles.conference_registration.headings.food', inline: true, big: true - = emailfield :companion, (@registration.housing_data['companions'] || [nil]).first, heading: 'articles.conference_registration.headings.companion', help: 'articles.conference_registration.paragraphs.companion', big: true - = textfield :allergies, @registration.allergies, heading: 'articles.conference_registration.headings.allergies' - = textarea :other, @registration.other, plain: true, heading: 'articles.conference_registration.headings.other' - = button_tag :register, :value => :questions + = columns(medium: 12) do + = radiobuttons :housing, ConferenceRegistration.all_housing_options, @registration.housing, 'articles.conference_registration.questions.housing', heading: 'articles.conference_registration.headings.housing', vertical: true, big: true, inline: true + = fieldset :hosting_dates, heading: 'articles.conference_registration.headings.arrival_and_departure', vars: { city: @this_conference.city_name } do + = selectfield :arrival, @registration.arrival || @this_conference.start_date, conference_days_options_list(:before_plus_one) + = selectfield :departure, @registration.departure || @this_conference.start_date, conference_days_options_list(:after_minus_one) + = radiobuttons :bike, ConferenceRegistration.all_bike_options, @registration.bike, 'articles.conference_registration.questions.bike', heading: 'articles.conference_registration.headings.bike', inline: true, big: true + = radiobuttons :food, ConferenceRegistration.all_food_options, @registration.food, 'articles.conference_registration.questions.food', heading: 'articles.conference_registration.headings.food', inline: true, big: true + = emailfield :companion, (@registration.housing_data['companions'] || [nil]).first, heading: 'articles.conference_registration.headings.companion', help: 'articles.conference_registration.paragraphs.companion', big: true + = textfield :allergies, @registration.allergies, heading: 'articles.conference_registration.headings.allergies' + = textarea :other, @registration.other, plain: true, heading: 'articles.conference_registration.headings.other' + = button_tag :register, :value => :questions diff --git a/app/views/conferences/register.html.haml b/app/views/conferences/register.html.haml index 803d281..919c252 100644 --- a/app/views/conferences/register.html.haml +++ b/app/views/conferences/register.html.haml @@ -1,4 +1,4 @@ -= render :partial => 'conferences/page_header', :locals => {:page_key => 'Conference_Administration'} += render :partial => 'conferences/page_header', :locals => {:page_key => 'Conference_Registration'} - if @warnings.present? = row class: 'warnings', tag: :ul do - @warnings.each do | warning | diff --git a/app/views/user_mailer/registration_confirmation.html.haml b/app/views/user_mailer/registration_confirmation.html.haml index 0152054..8e7b816 100644 --- a/app/views/user_mailer/registration_confirmation.html.haml +++ b/app/views/user_mailer/registration_confirmation.html.haml @@ -5,4 +5,4 @@ - else %p=_'email.registration.paragraph.confirmed', :vars => {:conference_title => @conference.title} - %p=_'email.general.paragraph.see_you', :vars => {:conference_location => @conference.location.city} + %p=_'email.general.paragraph.see_you', :vars => {:conference_location => @conference.city_name} diff --git a/app/views/user_mailer/registration_confirmation.text.haml b/app/views/user_mailer/registration_confirmation.text.haml index 91c494b..bc2dfe4 100644 --- a/app/views/user_mailer/registration_confirmation.text.haml +++ b/app/views/user_mailer/registration_confirmation.text.haml @@ -5,4 +5,4 @@ - else =_'email.registration.paragraph.confirmed', :vars => {:conference_title => @conference.title} - =_'email.general.paragraph.see_you', :vars => {:conference_location => @conference.location.city} \ No newline at end of file + =_'email.general.paragraph.see_you', :vars => {:conference_location => @conference.city_name} \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index de1a4d2..ad07b94 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1156,6 +1156,7 @@ en: Hosting: Hosting can_provide_housing: Can you provide housing to attendees visiting the city? questions: Your Visit + basic_info: Your Visit host: considerations: Special Considerations space: Available Space diff --git a/config/locales/es.yml b/config/locales/es.yml index 14281c4..5f16346 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -804,6 +804,7 @@ es: Workshops_You_Have_Requested: Talleres que te ofreciste a impartir All_Workshops: Todos los otros talleres questions: Tu Visita + basic_info: Tu Visita companion: AcompaƱante host: considerations: Consideraciones especiales