Registration alerts modified for splash

This commit is contained in:
Gopesh Tulsyan 2014-05-30 13:06:10 +05:30
parent 4d9f34c3cf
commit 0d3b0cfe2c
2 changed files with 16 additions and 5 deletions

View file

@ -100,13 +100,21 @@ class Conference < ActiveRecord::Base
# * +false+ -> If the conference dates are not set or today isn't in the # * +false+ -> If the conference dates are not set or today isn't in the
# registration period. # registration period.
# * +true+ -> If today is in the registration period. # * +true+ -> If today is in the registration period.
def registration_open? def registration_dates_given?
today = Date.current
if self.registration_start_date.blank? || self.registration_end_date.blank? if self.registration_start_date.blank? || self.registration_end_date.blank?
false false
else
true
end end
end
(registration_start_date..registration_end_date).cover?(today) def registration_open?
today = Date.current
if registration_dates_given?
(registration_start_date..registration_end_date).cover?(today)
else
false
end
end end
## ##

View file

@ -7,8 +7,11 @@
- if !@conference.registration_description.blank? - if !@conference.registration_description.blank?
%p %p
= @conference.registration_description = @conference.registration_description
- if @conference.registration_open? - if @conference.registration_dates_given?
%h4 Registration period #{ date_string(@conference.registration_start_date, @conference.registration_end_date) } -if @conference.registration_end_date > Date.today
%h4 Registration period #{ date_string(@conference.registration_start_date, @conference.registration_end_date) }
-else
%h4 Registration is Closed, it was from #{ date_string(@conference.registration_start_date, @conference.registration_end_date) }
- if @conference.registration_open? - if @conference.registration_open?
= link_to "Register for #{@conference.short_title}", register_conference_path(@conference.short_title), :class =>"btn btn-success btn-lg", target: '_blank' = link_to "Register for #{@conference.short_title}", register_conference_path(@conference.short_title), :class =>"btn btn-success btn-lg", target: '_blank'
- if @conference.use_supporter_levels? - if @conference.use_supporter_levels?