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,6 +20,9 @@ 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.present?
|
||||||
|
redirect_to admin_conference_splashpage_path(@conference.short_title)
|
||||||
|
else
|
||||||
if splashpage.include_cfp
|
if splashpage.include_cfp
|
||||||
cfps = @conference.program.cfps
|
cfps = @conference.program.cfps
|
||||||
@call_for_events = cfps.find { |call| call.cfp_type == 'events' }
|
@call_for_events = cfps.find { |call| call.cfp_type == 'events' }
|
||||||
|
|
@ -52,6 +55,7 @@ class ConferencesController < ApplicationController
|
||||||
).order('sponsorship_levels.position ASC', 'sponsors.name')
|
).order('sponsorship_levels.position ASC', 'sponsors.name')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue