Browse Source

Fixed registration for BBSE2017

development
Godwin 8 years ago
parent
commit
99be23056e
  1. 7
      app/assets/stylesheets/_application.scss
  2. 6
      app/controllers/conferences_controller.rb
  3. 4
      app/helpers/application_helper.rb
  4. 24
      app/views/conferences/_questions.html.haml
  5. 2
      app/views/conferences/register.html.haml
  6. 2
      app/views/user_mailer/registration_confirmation.html.haml
  7. 2
      app/views/user_mailer/registration_confirmation.text.haml
  8. 1
      config/locales/en.yml
  9. 1
      config/locales/es.yml

7
app/assets/stylesheets/_application.scss

@ -2977,11 +2977,15 @@ a.logo {
.conference-details { .conference-details {
.links { .links {
text-align: center; text-align: center;
font-size: 1.25em;
margin-bottom: 2em; margin-bottom: 2em;
.button { .button {
margin: 0 0.25em 0.5em; margin: 0 0.25em 0.5em;
vertical-align: middle;
}
.register {
font-size: 1.5em;
} }
} }
} }
@ -3881,6 +3885,7 @@ body.policy .policy-agreement ul {
> div { > div {
vertical-align: top; vertical-align: top;
margin-top: 2em;
h3, p:first-child { h3, p:first-child {
margin-top: 0; margin-top: 0;

6
app/controllers/conferences_controller.rb

@ -32,7 +32,7 @@ class ConferencesController < ApplicationController
if @this_conference.host? current_user if @this_conference.host? current_user
@links ||= [] @links ||= []
@links = [:administrate] @links = [:administrate, :register]
end end
end end
end end
@ -233,14 +233,14 @@ class ConferencesController < ApplicationController
steps ||= registration_steps steps ||= registration_steps
# make sure we're on a valid step # 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 logged_in? && @register_template != :paypal_confirm
# if we're logged in # if we're logged in
if !steps.include?(@register_template) if !steps.include?(@register_template)
# and we are not viewing a valid step # and we are not viewing a valid step
return redirect_to register_path(@this_conference.slug) 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 # 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) return redirect_to register_path(@this_conference.slug)
end end

4
app/helpers/application_helper.rb

@ -238,8 +238,8 @@ module ApplicationHelper
def registration_steps(conference = @conference) def registration_steps(conference = @conference)
{ {
pre: [:policy, :basic_info, :workshops], pre: [:policy, :contact_info, :workshops],
open: [:policy, :basic_info, :questions, :payment, :workshops] open: [:policy, :contact_info, :questions, :payment, :workshops]
}[@this_conference.registration_status] }[@this_conference.registration_status]
end end

24
app/views/conferences/_questions.html.haml

@ -1,14 +1,14 @@
= columns(medium: 12) do = 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 = form_tag register_path(@this_conference.slug), class: [:centered, :clearfix] do
= columns(medium: 12) 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 = 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 = 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 :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) = 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 :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 = 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 = 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' = textfield :allergies, @registration.allergies, heading: 'articles.conference_registration.headings.allergies'
= textarea :other, @registration.other, plain: true, heading: 'articles.conference_registration.headings.other' = textarea :other, @registration.other, plain: true, heading: 'articles.conference_registration.headings.other'
= button_tag :register, :value => :questions = button_tag :register, :value => :questions

2
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? - if @warnings.present?
= row class: 'warnings', tag: :ul do = row class: 'warnings', tag: :ul do
- @warnings.each do | warning | - @warnings.each do | warning |

2
app/views/user_mailer/registration_confirmation.html.haml

@ -5,4 +5,4 @@
- else - else
%p=_'email.registration.paragraph.confirmed', :vars => {:conference_title => @conference.title} %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}

2
app/views/user_mailer/registration_confirmation.text.haml

@ -5,4 +5,4 @@
- else - else
=_'email.registration.paragraph.confirmed', :vars => {:conference_title => @conference.title} =_'email.registration.paragraph.confirmed', :vars => {:conference_title => @conference.title}
=_'email.general.paragraph.see_you', :vars => {:conference_location => @conference.location.city} =_'email.general.paragraph.see_you', :vars => {:conference_location => @conference.city_name}

1
config/locales/en.yml

@ -1156,6 +1156,7 @@ en:
Hosting: Hosting Hosting: Hosting
can_provide_housing: Can you provide housing to attendees visiting the city? can_provide_housing: Can you provide housing to attendees visiting the city?
questions: Your Visit questions: Your Visit
basic_info: Your Visit
host: host:
considerations: Special Considerations considerations: Special Considerations
space: Available Space space: Available Space

1
config/locales/es.yml

@ -804,6 +804,7 @@ es:
Workshops_You_Have_Requested: Talleres que te ofreciste a impartir Workshops_You_Have_Requested: Talleres que te ofreciste a impartir
All_Workshops: Todos los otros talleres All_Workshops: Todos los otros talleres
questions: Tu Visita questions: Tu Visita
basic_info: Tu Visita
companion: Acompañante companion: Acompañante
host: host:
considerations: Consideraciones especiales considerations: Consideraciones especiales

Loading…
Cancel
Save