Merge branch 'master' into 176895554/mailbluster
This commit is contained in:
commit
d6fe38bb2c
22 changed files with 291 additions and 34 deletions
|
|
@ -50,7 +50,7 @@ module Admin
|
|||
:include_venue, :include_registrations,
|
||||
:include_tickets, :include_lodgings,
|
||||
:include_sponsors, :include_social_media,
|
||||
:include_booths)
|
||||
:include_booths, :include_happening_now)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
class ApplicationController < ActionController::Base
|
||||
before_action :set_paper_trail_whodunnit
|
||||
include ApplicationHelper
|
||||
include Pagy::Backend
|
||||
add_flash_types :error
|
||||
protect_from_forgery with: :exception, prepend: true
|
||||
before_action :store_location
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
EVENTS_PER_PAGE = 3
|
||||
|
||||
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
|
||||
|
|
@ -56,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')
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class SchedulesController < ApplicationController
|
||||
include ConferenceHelper
|
||||
|
||||
load_and_authorize_resource
|
||||
before_action :respond_to_options
|
||||
load_resource :conference, find_by: :short_title
|
||||
|
|
@ -67,15 +69,12 @@ class SchedulesController < ApplicationController
|
|||
end
|
||||
|
||||
def happening_now
|
||||
@events_schedules = @program.selected_event_schedules(
|
||||
includes: [:room, { event: %i[track event_type speakers submitter] }]
|
||||
).select(&:happening_now?)
|
||||
@events_schedules = [] unless @events_schedules
|
||||
@events_schedules = get_happening_now_events_schedules(@conference)
|
||||
@current_time = Time.now.in_time_zone(@conference.timezone)
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.json { render json: @events_schedules.as_json(root: false, include: :event) }
|
||||
format.json { render json: @events_schedules.to_json(root: false, include: :event) }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue