Logic for showing splashpage is not the views' concern

That's the responsibility of ConferenceController & cancancan, and
they handle it fine.
This commit is contained in:
James Mason 2017-11-20 19:46:12 -08:00
parent 995176ffe5
commit e60dc8c09d

View file

@ -11,74 +11,73 @@
= @conference.title = @conference.title
#splash #splash
- if @conference.splashpage #banner
#banner .container
.row
.col-md-8.col-md-offset-2#header
.row
.col-md-4
= image_tag(@conference.picture_url, class: 'img-responsive img-center', id: 'splash-logo') if @conference.picture?
.col-md-8
%h1
= @conference.title
%p.lead
- if @conference.venue
= "#{@conference.venue.city} / #{@conference.venue.country_name}"
- if @conference.start_date && @conference.end_date
%br
= date_string(@conference.start_date, @conference.end_date)
- unless @conference.description.blank?
%section#about
.container .container
.row .row
.col-md-8.col-md-offset-2#header .col-md-8.col-md-offset-2
.row %h3.text-center
.col-md-4 = markdown(@conference.description)
= image_tag(@conference.picture_url, class: 'img-responsive img-center', id: 'splash-logo') if @conference.picture?
.col-md-8
%h1
= @conference.title
%p.lead
- if @conference.venue
= "#{@conference.venue.city} / #{@conference.venue.country_name}"
- if @conference.start_date && @conference.end_date
%br
= date_string(@conference.start_date, @conference.end_date)
- unless @conference.description.blank? - if @conference.splashpage.include_registrations && @conference.registration_open?
%section#about %section#registration
.container = render 'registration'
.row
.col-md-8.col-md-offset-2
%h3.text-center
= markdown(@conference.description)
- if @conference.splashpage.include_registrations && @conference.registration_open? - if @conference.splashpage.include_program
%section#registration %section#program
= render 'registration' = render 'schedule_splashpage'
- if @conference.splashpage.include_program - if @conference.splashpage.include_cfp && @conference.call_for_events.try(:open?)
%section#program %section#callforpapers
= render 'schedule_splashpage' = render 'call_for_paper'
- if @conference.splashpage.include_cfp && @conference.call_for_events.try(:open?) - if @conference.splashpage.include_cfp && @conference.call_for_tracks.try(:open?)
%section#callforpapers %section#callfortracks
= render 'call_for_paper' = render 'call_for_tracks'
- if @conference.splashpage.include_cfp && @conference.call_for_tracks.try(:open?) - if @conference.splashpage.include_venue && @conference.venue
%section#callfortracks %section#venue
= render 'call_for_tracks' = render 'venue'
- if @conference.splashpage.include_venue && @conference.venue - if @conference.splashpage.include_lodgings && @conference.lodgings.any?
%section#venue %section#lodging
= render 'venue' = render 'lodging'
- if @conference.splashpage.include_lodgings && @conference.lodgings.any? - if @conference.splashpage.include_tickets && @conference.tickets.any? && @conference.pending?
%section#lodging %section#tickets
= render 'lodging' = render 'tickets'
- if @conference.splashpage.include_tickets && @conference.tickets.any? && @conference.pending? - if @conference.splashpage.include_booths && @conference.confirmed_booths.any?
%section#tickets %section#booths
= render 'tickets' = render 'booths'
- if @conference.splashpage.include_booths && @conference.confirmed_booths.any? - if @conference.splashpage.include_sponsors && @conference.sponsors.any?
%section#booths %section#sponsors
= render 'booths' = render 'sponsors'
- if @conference.splashpage.include_sponsors && @conference.sponsors.any? - if @conference.splashpage.include_social_media && @conference.contact.has_social_media?
%section#sponsors %section#social-media
= render 'sponsors' = render 'social_media'
- if @conference.splashpage.include_social_media && @conference.contact.has_social_media? // grmbl
%section#social-media = render 'footer'
= render 'social_media'
// grmbl
= render 'footer'
- content_for :script_head do - content_for :script_head do
:javascript :javascript