Added condition to check for existing splashpage. Will redirect user if splashpage is not found.
This commit is contained in:
parent
e3b83e8ec1
commit
34af9b840b
1 changed files with 31 additions and 27 deletions
|
|
@ -20,36 +20,40 @@ class ConferencesController < ApplicationController
|
||||||
authorize! :show, @conference # TODO: reduce the 10 queries performed here
|
authorize! :show, @conference # TODO: reduce the 10 queries performed here
|
||||||
|
|
||||||
splashpage = @conference.splashpage
|
splashpage = @conference.splashpage
|
||||||
if splashpage.include_cfp
|
if !splashpage.present?
|
||||||
cfps = @conference.program.cfps
|
redirect_to admin_conference_splashpage_path(@conference.short_title)
|
||||||
@call_for_events = cfps.find { |call| call.cfp_type == 'events' }
|
else
|
||||||
if @call_for_events.try(:open?)
|
if splashpage.include_cfp
|
||||||
@event_types = @conference.event_types.pluck(:title)
|
cfps = @conference.program.cfps
|
||||||
@track_names = @conference.confirmed_tracks.pluck(:name).sort
|
@call_for_events = cfps.find { |call| call.cfp_type == 'events' }
|
||||||
|
if @call_for_events.try(:open?)
|
||||||
|
@event_types = @conference.event_types.pluck(:title)
|
||||||
|
@track_names = @conference.confirmed_tracks.pluck(:name).sort
|
||||||
|
end
|
||||||
|
@call_for_tracks = cfps.find { |call| call.cfp_type == 'tracks' }
|
||||||
end
|
end
|
||||||
@call_for_tracks = cfps.find { |call| call.cfp_type == 'tracks' }
|
if splashpage.include_program
|
||||||
end
|
@highlights = @conference.highlighted_events.eager_load(:speakers)
|
||||||
if splashpage.include_program
|
if splashpage.include_tracks
|
||||||
@highlights = @conference.highlighted_events.eager_load(:speakers)
|
@tracks = @conference.confirmed_tracks.eager_load(
|
||||||
if splashpage.include_tracks
|
:room
|
||||||
@tracks = @conference.confirmed_tracks.eager_load(
|
).order('tracks.name')
|
||||||
:room
|
end
|
||||||
).order('tracks.name')
|
if splashpage.include_booths
|
||||||
|
@booths = @conference.confirmed_booths.order('title')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if splashpage.include_booths
|
if splashpage.include_registrations || splashpage.include_tickets
|
||||||
@booths = @conference.confirmed_booths.order('title')
|
@tickets = @conference.tickets.order('price_cents')
|
||||||
|
end
|
||||||
|
if splashpage.include_lodgings
|
||||||
|
@lodgings = @conference.lodgings.order('name')
|
||||||
|
end
|
||||||
|
if splashpage.include_sponsors
|
||||||
|
@sponsorship_levels = @conference.sponsorship_levels.eager_load(
|
||||||
|
:sponsors
|
||||||
|
).order('sponsorship_levels.position ASC', 'sponsors.name')
|
||||||
end
|
end
|
||||||
end
|
|
||||||
if splashpage.include_registrations || splashpage.include_tickets
|
|
||||||
@tickets = @conference.tickets.order('price_cents')
|
|
||||||
end
|
|
||||||
if splashpage.include_lodgings
|
|
||||||
@lodgings = @conference.lodgings.order('name')
|
|
||||||
end
|
|
||||||
if splashpage.include_sponsors
|
|
||||||
@sponsorship_levels = @conference.sponsorship_levels.eager_load(
|
|
||||||
:sponsors
|
|
||||||
).order('sponsorship_levels.position ASC', 'sponsors.name')
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue