mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Refactored condition to check if splashpage is present.
This commit is contained in:
parent
34af9b840b
commit
afff7e1c66
1 changed files with 32 additions and 31 deletions
|
|
@ -20,41 +20,42 @@ class ConferencesController < ApplicationController
|
|||
authorize! :show, @conference # TODO: reduce the 10 queries performed here
|
||||
|
||||
splashpage = @conference.splashpage
|
||||
if !splashpage.present?
|
||||
redirect_to admin_conference_splashpage_path(@conference.short_title)
|
||||
else
|
||||
if splashpage.include_cfp
|
||||
cfps = @conference.program.cfps
|
||||
@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' }
|
||||
|
||||
unless splashpage.present?
|
||||
redirect_to admin_conference_splashpage_path(@conference.short_title) and return
|
||||
end
|
||||
|
||||
if splashpage.include_cfp
|
||||
cfps = @conference.program.cfps
|
||||
@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
|
||||
if splashpage.include_program
|
||||
@highlights = @conference.highlighted_events.eager_load(:speakers)
|
||||
if splashpage.include_tracks
|
||||
@tracks = @conference.confirmed_tracks.eager_load(
|
||||
:room
|
||||
).order('tracks.name')
|
||||
end
|
||||
if splashpage.include_booths
|
||||
@booths = @conference.confirmed_booths.order('title')
|
||||
end
|
||||
@call_for_tracks = cfps.find { |call| call.cfp_type == 'tracks' }
|
||||
end
|
||||
if splashpage.include_program
|
||||
@highlights = @conference.highlighted_events.eager_load(:speakers)
|
||||
if splashpage.include_tracks
|
||||
@tracks = @conference.confirmed_tracks.eager_load(
|
||||
:room
|
||||
).order('tracks.name')
|
||||
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')
|
||||
if splashpage.include_booths
|
||||
@booths = @conference.confirmed_booths.order('title')
|
||||
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
|
||||
|
||||
private
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue