| Class | Admin::FirstAidProvidersController |
| In: |
app/controllers/admin/first_aid_providers_controller.rb
|
| Parent: | Admin::AdminController |
Work assignments for Event. First aid provider and chief official. Officials can view, but not edit, this page.
Formatted for "who would like to work this race email"
# File app/controllers/admin/first_aid_providers_controller.rb, line 33
33: def email
34: rows = @events.collect do |event|
35: [event.first_aid_provider, event.date.strftime("%a %m/%d") , event.name, event.city_state]
36: end
37: grid = Grid.new(rows)
38: grid.truncate_rows
39: grid.calculate_padding
40:
41: headers['Content-Type'] = 'text/plain'
42:
43: render :text => grid.to_s(false)
44: end
# File app/controllers/admin/first_aid_providers_controller.rb, line 8
8: def index
9: @year = RacingAssociation.current.effective_year
10:
11: @past_events = params[:past_events] || false
12: if @past_events
13: conditions = ['date >= ?', RacingAssociation.current.effective_today ]
14: else
15: conditions = ['date >= CURDATE()']
16: end
17:
18: if params[:sort_by].present?
19: @sort_by = params[:sort_by]
20: else
21: @sort_by = "date"
22: end
23:
24: @events = SingleDayEvent.find(:all, :conditions => conditions)
25:
26: respond_to do |format|
27: format.html
28: format.text { email }
29: end
30: end