diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb index 7f3bbfbd..efe33354 100644 --- a/app/controllers/conferences_controller.rb +++ b/app/controllers/conferences_controller.rb @@ -40,7 +40,7 @@ class ConferencesController < ApplicationController @image_url = "#{request.protocol}#{request.host}#{@conference.picture}" - if splashpage.include_cfp + if splashpage.include_cfp? cfps = @conference.program.cfps @call_for_events = cfps.find { |call| call.cfp_type == 'events' } if @call_for_events.try(:open?) @@ -50,27 +50,27 @@ class ConferencesController < ApplicationController @call_for_tracks = cfps.find { |call| call.cfp_type == 'tracks' } @call_for_booths = cfps.find { |call| call.cfp_type == 'booths' } end - if splashpage.include_program + if splashpage.include_program? @highlights = @conference.highlighted_events.eager_load(:speakers) - if splashpage.include_tracks + if splashpage.include_tracks? @tracks = @conference.confirmed_tracks.eager_load( :room ).order('tracks.name') end - if splashpage.include_booths + if splashpage.include_booths? @booths = @conference.confirmed_booths.order('title') end - if splashpage.include_happening_now + if splashpage.include_happening_now? load_happening_now end end - if splashpage.include_registrations || splashpage.include_tickets + if splashpage.include_registrations? || splashpage.include_tickets? @tickets = @conference.tickets.visible.order('price_cents') end - if splashpage.include_lodgings + if splashpage.include_lodgings? @lodgings = @conference.lodgings.order('id') end - if splashpage.include_sponsors + if splashpage.include_sponsors? @sponsorship_levels = @conference.sponsorship_levels.eager_load( :sponsors ).order('sponsorship_levels.position ASC', 'sponsors.name') diff --git a/app/helpers/conference_helper.rb b/app/helpers/conference_helper.rb index 9c22ac5f..16a8cbb6 100644 --- a/app/helpers/conference_helper.rb +++ b/app/helpers/conference_helper.rb @@ -89,7 +89,7 @@ module ConferenceHelper def get_happening_next_events_schedules(conference) events_schedules = conference.program.selected_event_schedules( includes: [:room, { event: %i[track event_type speakers submitter] }] - ).select(&:happening_next?) + ).select(&:happening_later?) if events_schedules.empty? return [] diff --git a/app/models/event_schedule.rb b/app/models/event_schedule.rb index 4ab7baad..f8a41d64 100644 --- a/app/models/event_schedule.rb +++ b/app/models/event_schedule.rb @@ -70,7 +70,7 @@ class EventSchedule < ApplicationRecord event_time_range.overlaps?(now_range) end - def happening_next? + def happening_later? # TODO: Save start_time with local timezone info when making an event schedule in_tz_start = start_time.in_time_zone(timezone) in_tz_start -= in_tz_start.utc_offset diff --git a/app/views/admin/emails/_help.html.haml b/app/views/admin/emails/_help.html.haml index d62589b0..1222c1ac 100644 --- a/app/views/admin/emails/_help.html.haml +++ b/app/views/admin/emails/_help.html.haml @@ -57,7 +57,7 @@ - if @conference.program.schedule_public %td {schedule_link} %td The link to complete schedule of the conference - - if @conference.splashpage && @conference.splashpage.public + - if @conference.splashpage && @conference.splashpage.public? %tr %td {conference_splash_link} %td The link to conference splash page diff --git a/app/views/admin/splashpages/show.html.haml b/app/views/admin/splashpages/show.html.haml index 08edb140..e3732b89 100644 --- a/app/views/admin/splashpages/show.html.haml +++ b/app/views/admin/splashpages/show.html.haml @@ -49,7 +49,7 @@ %i{ class: "fa-li #{icon_for_todo @splashpage.include_social_media?}" } Display social media links %li - - if @conference.splashpage && @conference.splashpage.public + - if @conference.splashpage && @conference.splashpage.public? %i{ class: "fa-li #{icon_for_todo @splashpage.public?}" } %text-muted.publicorprivate Public - else diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index 21581351..ed642f34 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -53,18 +53,18 @@ is_happening_next: @is_happening_next -# calls for content, or program - - if @conference.splashpage.include_cfp + - if @conference.splashpage.include_cfp? = render 'call_for_content', conference: @conference, call_for_events: @call_for_events, call_for_tracks: @call_for_tracks, call_for_booths: @call_for_booths, event_types: @event_types, tracks: @track_names - - if @conference.splashpage.include_program + - if @conference.splashpage.include_program? = render 'program', conference: @conference, tracks: @tracks, highlights: @highlights, booths: @booths -# attendance/registration - - if @conference.splashpage.include_registrations + - if @conference.splashpage.include_registrations? - if @conference.registration_open? = render 'registration', conference: @conference, registration_period: @conference.registration_period, @@ -73,20 +73,20 @@ = render 'tickets', conference: @conference, tickets: @tickets -# geo - - if @conference.splashpage.include_venue && @conference.venue + - if @conference.splashpage.include_venue? && @conference.venue = render 'venue', conference: @conference, venue: @conference.venue, commercial: @conference.venue.commercial - if @conference.splashpage.include_lodgings && @conference.lodgings.any? = render 'lodging', venue: @conference.venue, lodgings: @lodgings -# sponsorship - - if @conference.splashpage.include_sponsors + - if @conference.splashpage.include_sponsors? = render 'sponsors', conference: @conference, sponsorship_levels: @sponsorship_levels, sponsors: @sponsors -# footer - - if @conference.splashpage.include_social_media + - if @conference.splashpage.include_social_media? - if @conference.contact.has_social_media? = render 'social_media', contact: @conference.contact = render 'footer'