[feat]Display happening now only if program is also displayed

This commit is contained in:
Jimmy 2021-04-10 00:44:42 +08:00 committed by CactusPuppy
parent 497818cc45
commit fec78dccce
No known key found for this signature in database
GPG key ID: 4B33B0A3E15E2C82
5 changed files with 15 additions and 16 deletions

View file

@ -60,6 +60,13 @@ class ConferencesController < ApplicationController
if splashpage.include_booths
@booths = @conference.confirmed_booths.order('title')
end
if splashpage.include_happening_now
events_schedules_list = get_happening_now_events_schedules(@conference)
@events_schedules_limit = EVENTS_PER_PAGE
@events_schedules_length = events_schedules_list.length
@pagy, @events_schedules = pagy_array(events_schedules_list, items: @events_schedules_limit, link_extra: 'data-remote="true"')
@happening_now_url = happening_now_conference_schedule_path(conference_id: @conference.short_title, format: :json)
end
end
if splashpage.include_registrations || splashpage.include_tickets
@tickets = @conference.tickets.visible.order('price_cents')
@ -73,13 +80,6 @@ class ConferencesController < ApplicationController
).order('sponsorship_levels.position ASC', 'sponsors.name')
@sponsors = @conference.sponsors
end
if splashpage.include_happening_now
events_schedules_list = get_happening_now_events_schedules(@conference)
@events_schedules_limit = EVENTS_PER_PAGE
@events_schedules_length = events_schedules_list.length
@pagy, @events_schedules = pagy_array(events_schedules_list, items: @events_schedules_limit, link_extra: 'data-remote="true"')
@happening_now_url = happening_now_conference_schedule_path(conference_id: @conference.short_title, format: :json)
end
end
def calendar

View file

@ -25,6 +25,8 @@
= f.input :include_tracks, label: 'Include confirmed tracks', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_tracks) }
%li
= f.input :include_booths, label: "Include confirmed #{(t'booth').pluralize}", input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_booths) }
%li
= f.input :include_happening_now, label: 'Include events happening now', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_happening_now) }
%li
= f.input :include_registrations, label: 'Display the registration period', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_registrations) }
@ -44,9 +46,6 @@
%li
= f.input :include_social_media, label: 'Display social media links', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_social_media) }
%li
= f.input :include_happening_now, label: 'Display events happening now', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_happening_now) }
= f.inputs name: 'Access' do
%ul.fa-ul
%li

View file

@ -27,6 +27,9 @@
%li
%i{ class: "fa-li #{icon_for_todo @splashpage.include_booths?}" }
Include confirmed #{(t'booth').pluralize}
%li
%i{ class: "fa-li #{icon_for_todo @splashpage.include_happening_now?}" }
Include events happening now
%li
%i{ class: "fa-li #{icon_for_todo @splashpage.include_registrations?}" }
Display the registration period
@ -45,9 +48,6 @@
%li
%i{ class: "fa-li #{icon_for_todo @splashpage.include_social_media?}" }
Display social media links
%li
%i{ class: "fa-li #{icon_for_todo @splashpage.include_happening_now?}" }
Display events happening now
%li
- if @conference.splashpage && @conference.splashpage.public
%i{ class: "fa-li #{icon_for_todo @splashpage.public?}" }

View file

@ -15,7 +15,7 @@
.container
.row
-# happening now events are displayed second in md or lg view
- if conference.splashpage.include_happening_now?
- if conference.splashpage.include_happening_now && conference.splashpage.include_program
- if conference.description.present?
.col-md-6.col-md-push-6.col-lg-4.col-lg-push-8
= yield :happening_now
@ -23,7 +23,7 @@
.col-md-12
= yield :happening_now
- if conference.description.present?
- if conference.splashpage.include_happening_now?
- if conference.splashpage.include_happening_now && conference.splashpage.include_program
.col-md-6.col-md-pull-6.col-lg-8.col-lg-pull-4
= yield :about
- else

View file

@ -1,4 +1,4 @@
- if conference.splashpage.include_happening_now
- if conference.splashpage.include_program && conference.splashpage.include_happening_now
- if events_schedules.any?
.row
%h2.text-center{ style: 'margin-bottom:30px' } Happening Now