Browse Source

Padded arrival and departure with one extra day

development
Godwin 8 years ago
parent
commit
81f5c21f43
  1. 2
      app/helpers/application_helper.rb
  2. 4
      app/views/conferences/_questions.html.haml

2
app/helpers/application_helper.rb

@ -754,6 +754,8 @@ module ApplicationHelper
belongs_to_periods = []
belongs_to_periods << :before if day <= conference.start_date
belongs_to_periods << :after if day >= conference.end_date
belongs_to_periods << :before_plus_one if day <= (conference.start_date + 1.day)
belongs_to_periods << :after_minus_one if day >= (conference.end_date - 1.day)
belongs_to_periods << :during if day >= conference.start_date && day <= conference.end_date
days << [date(day.to_date, format || :span_same_year_date_1), day] if belongs_to_periods.include?(period)
end

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

@ -4,8 +4,8 @@
= 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)
= selectfield :departure, @registration.departure || @this_conference.start_date, conference_days_options_list(:after)
= 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

Loading…
Cancel
Save