Browse files

Remove RSVP stuff when event is passed.

  • Loading branch information...
1 parent e1ecbe3 commit ee476af21a6d200f99c5ca9e906178f597292fe3 @metaskills committed Nov 4, 2009
View
4 app/models/rsvp.rb
@@ -44,6 +44,10 @@ def event_today?
event_date == Date.today
end
+ def event_passed?
+ event_date < Date.today
+ end
+
end
View
93 app/views/layouts/application.html.haml
@@ -38,52 +38,53 @@
= yield
#content_right
- #rsvp_stuff{:style => "display:#{current_rsvp && current_rsvp.reserved? ? 'none' : 'block'};"}
- .flash_alert{:style => "display:#{Rsvp.open_seats? ? 'none' : 'block'};", :id => 'rsvp_flash_alert'}
- All seats reserved! Use the RSVP form to be placed on the waiting list. Follow us on Twitter for updates.
- #rsvp_button{:style => "display:#{current_rsvp && !current_rsvp.reserved? ? 'none' : 'block'};"}
- .flash_indif{:style => "display:#{session[:rsvp_id] ? 'block' : 'none'};", :id => 'rsvp_flash_indif'}
- Please verify your reservation by clicking the link contained in
- the email we sent to you at: <strong id="your_rsvp_email">
- = current_rsvp.try(:email)
- </strong>
- - if current_rsvp
- %div{:class => 'mt5 right'}
- = link_to '[remove message]', clear_rsvp_path(current_rsvp), :method => :put
- #rsvp_text
- ATTENDANCE IS FREE!<br/>
- Space is limited to
- = Rsvp::MAX_SEATS
- seats and<br/>
- is first come, first served.<br/>
- RSVP now and reserve yours!
- #rsvp_form{:style => 'display:none;'}
- .flash_bad{:style => 'display:none;', :id => 'rsvp_flash_bad'}
- - form_for @rsvp do |f|
- %table.form_table
- %tr
- %th Name
- %td= f.text_field :name
- %tr
- %th Company
- %td= f.text_field :company
- %tr
- %th Email
- %td= f.text_field :email
- %tr
- %th Attendees
- %td= f.select :attendees, Rsvp::ATTENDEE_RANGE
- %tr
- %th
- %td{:class => 'vmiddle_all'}
- = submit_tag 'RSVP Now', :id => 'rsvp_submit'
- %input{:type => 'button', :value => 'Cancel', :id => 'rsvp_cancel'}
- = image_tag '/images/layout/loading_invert.gif', :id => 'rsvp_loading', :style => 'display:none;'
-
- #schedule
- %h5 Schedule
- #schedule_date November 5th, 2009
- = render_schedule(false)
+
+ - unless Rsvp.event_passed?
+ #rsvp_stuff{:style => "display:#{current_rsvp && current_rsvp.reserved? ? 'none' : 'block'};"}
+ .flash_alert{:style => "display:#{Rsvp.open_seats? ? 'none' : 'block'};", :id => 'rsvp_flash_alert'}
+ All seats reserved! Use the RSVP form to be placed on the waiting list. Follow us on Twitter for updates.
+ #rsvp_button{:style => "display:#{current_rsvp && !current_rsvp.reserved? ? 'none' : 'block'};"}
+ .flash_indif{:style => "display:#{session[:rsvp_id] ? 'block' : 'none'};", :id => 'rsvp_flash_indif'}
+ Please verify your reservation by clicking the link contained in
+ the email we sent to you at: <strong id="your_rsvp_email">
+ = current_rsvp.try(:email)
+ </strong>
+ - if current_rsvp
+ %div{:class => 'mt5 right'}
+ = link_to '[remove message]', clear_rsvp_path(current_rsvp), :method => :put
+ #rsvp_text
+ ATTENDANCE IS FREE!<br/>
+ Space is limited to
+ = Rsvp::MAX_SEATS
+ seats and<br/>
+ is first come, first served.<br/>
+ RSVP now and reserve yours!
+ #rsvp_form{:style => 'display:none;'}
+ .flash_bad{:style => 'display:none;', :id => 'rsvp_flash_bad'}
+ - form_for @rsvp do |f|
+ %table.form_table
+ %tr
+ %th Name
+ %td= f.text_field :name
+ %tr
+ %th Company
+ %td= f.text_field :company
+ %tr
+ %th Email
+ %td= f.text_field :email
+ %tr
+ %th Attendees
+ %td= f.select :attendees, Rsvp::ATTENDEE_RANGE
+ %tr
+ %th
+ %td{:class => 'vmiddle_all'}
+ = submit_tag 'RSVP Now', :id => 'rsvp_submit'
+ %input{:type => 'button', :value => 'Cancel', :id => 'rsvp_cancel'}
+ = image_tag '/images/layout/loading_invert.gif', :id => 'rsvp_loading', :style => 'display:none;'
+ #schedule
+ %h5 Schedule
+ #schedule_date November 5th, 2009
+ = render_schedule(false)
#twitterfollow
- link_to 'http://twitter.com/757studio' do
View
BIN public/images/layout/follow_757studio_on_twitter.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
1 test/integration/visitor_story_test.rb
@@ -4,6 +4,7 @@ class VisitorStoryTest < ActionController::IntegrationTest
def setup
Rsvp.delete_all
+ Rsvp.stubs :event_passed? => false
end
should 'A basic user path' do

0 comments on commit ee476af

Please sign in to comment.