Check for cfp object before rendering partial

Fixed horizontal overflow in splash due to cfp timer

Fixed condition for rendering cfp
This commit is contained in:
Gopesh Tulsyan 2014-06-05 13:50:05 +05:30
parent a95a03c7e5
commit 005bead45f
2 changed files with 24 additions and 23 deletions

View file

@ -13,27 +13,27 @@
- if !@conference.call_for_papers.start_date.blank? && !@conference.call_for_papers.end_date.blank?
%p Proposals will be accepted between
#{ date_string(@conference.call_for_papers.start_date, @conference.call_for_papers.end_date) }
- if @conference.cfp_open?
- if @conference.call_for_papers.end_date.to_time < Time.now
%p Today is the last day. Hurry Up!
- else
%div.row.col-md-12.col-md-offset-2
%div.col-md-2
%h2#days
%p Days
%div.col-md-2
%h2#hours
%p Hours
%div.col-md-2
%h2#minutes
%p Minutes
%div.col-md-2
%h2#seconds
%p Seconds
%p
= link_to "Submit Your Proposals Today", conference_proposal_index_path(@conference.short_title), class: 'btn btn-info', target: '_blank'
-else
%h3 Deadline has ended
- if @conference.cfp_open?
- if @conference.call_for_papers.end_date.to_time < Time.now
%p Today is the last day. Hurry Up!
- else
%div.row.col-md-6.col-md-offset-4
%div.col-md-2
%h2#days
%p Days
%div.col-md-2
%h2#hours
%p Hours
%div.col-md-2
%h2#minutes
%p Minutes
%div.col-md-2
%h2#seconds
%p Seconds
%p
= link_to "Submit Your Proposals Today", conference_proposal_index_path(@conference.short_title), class: 'btn btn-info', target: '_blank'
-else
%h3 Deadline has ended
:javascript
$( document ).ready(function(){

View file

@ -4,6 +4,7 @@
= render 'program'
%div#registration
= render 'registration'
%div#callforpapers
= render 'call_for_papers'
-unless @conference.call_for_papers.blank?
%div#callforpapers
= render 'call_for_papers'