[feat] Display happening now events in splashpage

This commit is contained in:
Jimmy 2021-04-07 10:34:49 +08:00
parent 85cfb0cbef
commit eda0c1a175
2 changed files with 12 additions and 4 deletions

View file

@ -1,6 +1,8 @@
# frozen_string_literal: true
class ConferencesController < ApplicationController
include ConferenceHelper
protect_from_forgery with: :null_session
before_action :respond_to_options
load_and_authorize_resource find_by: :short_title, except: :show
@ -70,6 +72,7 @@ class ConferencesController < ApplicationController
@sponsors = @conference.sponsors
end
if splashpage.include_happening_now
@events_schedules = get_happening_now_events_schedules(@conference)
@happening_now_url = happening_now_conference_schedule_path(conference_id: @conference.short_title, format: :json)
end
end

View file

@ -46,10 +46,15 @@
-# happening now events
- if @conference.splashpage.include_happening_now
.row
.col-md-12
#happening_now_panel
%h3.text-center There are no events happening now.
- if @events_schedules.any?
- for event_schedule in @events_schedules
.container
= render 'schedules/event', conference: @conference, event_schedule: event_schedule, event: event_schedule.event
- else
.row
.col-md-12
#happening_now_panel
%h3.text-center There are no events happening now.
-# calls for content, or program
- if @conference.splashpage.include_cfp