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,9 +20,11 @@ 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)
|
unless splashpage.present?
|
||||||
else
|
redirect_to admin_conference_splashpage_path(@conference.short_title) and return
|
||||||
|
end
|
||||||
|
|
||||||
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' }
|
||||||
|
|
@ -55,7 +57,6 @@ 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