Issue #649: Wrong days remaining label when submitting a new proposal
This commit is contained in:
parent
124d275a09
commit
1de8f979cd
4 changed files with 23 additions and 18 deletions
|
|
@ -63,6 +63,11 @@ class CallForPaper < ActiveRecord::Base
|
||||||
&& !self.conference.email_settings.call_for_papers_dates_updates_template.blank?
|
&& !self.conference.email_settings.call_for_papers_dates_updates_template.blank?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def remaining_days(date = Date.today)
|
||||||
|
result = (self.end_date - date).to_i
|
||||||
|
result > 0 ? result : 0
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def before_end_of_conference
|
def before_end_of_conference
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,7 @@
|
||||||
%dt
|
%dt
|
||||||
Days Left:
|
Days Left:
|
||||||
%dd
|
%dd
|
||||||
- days = (@call_for_paper.end_date - Date.today).to_i
|
= pluralize(@call_for_paper.remaining_days, 'day')
|
||||||
= pluralize(days, 'days')
|
|
||||||
%dt
|
%dt
|
||||||
Event types:
|
Event types:
|
||||||
%dd
|
%dd
|
||||||
|
|
|
||||||
|
|
@ -25,14 +25,15 @@
|
||||||
and closes
|
and closes
|
||||||
%em
|
%em
|
||||||
= @conference.call_for_paper.end_date.strftime('%A, %B %-d. %Y.')
|
= @conference.call_for_paper.end_date.strftime('%A, %B %-d. %Y.')
|
||||||
|
- if @conference.cfp_open?
|
||||||
That means you have only
|
That means you have only
|
||||||
- days = (@conference.call_for_paper.end_date - Date.today).to_i
|
%b= pluralize(@conference.call_for_paper.remaining_days, 'day')
|
||||||
%b
|
|
||||||
= pluralize(days, 'days')
|
|
||||||
left!
|
left!
|
||||||
Remember
|
Remember
|
||||||
= @conference.short_title
|
= @conference.short_title
|
||||||
will only be as good as the sessions you present. Submit early, submit often!
|
will only be as good as the sessions you present. Submit early, submit often!
|
||||||
|
- else
|
||||||
|
The submission period is closed.
|
||||||
.row
|
.row
|
||||||
.col-md-12.text-center
|
.col-md-12.text-center
|
||||||
%p.cta-button
|
%p.cta-button
|
||||||
|
|
|
||||||
|
|
@ -6,18 +6,18 @@
|
||||||
Proposals should fit in one of the
|
Proposals should fit in one of the
|
||||||
= "#{pluralize(@conference.tracks.count, 'track')}:"
|
= "#{pluralize(@conference.tracks.count, 'track')}:"
|
||||||
= "#{tracks(@conference)}."
|
= "#{tracks(@conference)}."
|
||||||
- if @conference.call_for_paper
|
- if @conference.cfp_open?
|
||||||
The submission period has begun
|
The submission period has begun
|
||||||
%em
|
%em
|
||||||
= @conference.call_for_paper.start_date.strftime('%A, %B %-d. %Y')
|
= @conference.call_for_paper.start_date.strftime('%A, %B %-d. %Y')
|
||||||
and closes
|
and closes
|
||||||
%em
|
%em
|
||||||
= @conference.call_for_paper.end_date.strftime('%A, %B %-d. %Y.')
|
= @conference.call_for_paper.end_date.strftime('%A, %B %-d. %Y.')
|
||||||
That means you have only
|
That means you have
|
||||||
- days = (@conference.call_for_paper.end_date - Date.today).to_i
|
%b= pluralize(@conference.call_for_paper.remaining_days, 'day')
|
||||||
%b
|
|
||||||
= pluralize(days, 'days')
|
|
||||||
left!
|
left!
|
||||||
Remember
|
Remember
|
||||||
= @conference.title
|
= @conference.title
|
||||||
will only be as good as the content you present. Submit early, submit often!
|
will only be as good as the content you present. Submit early, submit often!
|
||||||
|
-else
|
||||||
|
The submission period is closed now.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue