Browse files

add events by track report

  • Loading branch information...
1 parent 71cb152 commit 83628947cff0c55a68e4894b313d52f2b56586eb @manno manno committed Apr 20, 2012
View
10 app/controllers/reports_controller.rb
@@ -87,6 +87,16 @@ def show_statistics
@search_count = 0
case @report_type
+ when 'events_by_track'
+ @data = []
+ row = []
+ @labels = Track.all.collect { |t| t.name }
+ @labels.each { |track|
+ row << @conference.events.confirmed.joins(:track).where(:tracks => { :name => track}).count
+ }
+ @data << row
+ @search_count = row.inject(:+)
+
when 'event_timeslot_sum'
@data = []
row = []
View
2 app/views/events/_table.html.haml
@@ -23,7 +23,7 @@
= link_to event.title, event
%p.small
by
- = event.event_people.select{|p| p.event_role == "speaker" or p.event_role == "moderator"}.map{ |p| link_to p.person.full_public_name, p.person}.join(", ").html_safe
+ = event.speakers.map{ |p| link_to p.person.full_public_name, p.person}.join(", ").html_safe
%td= event.track.try(:name)
%td= event.event_type
%td= event.state
View
1 app/views/reports/_report_menu.html.haml
@@ -15,3 +15,4 @@
%p Statistics
%ul
%li= link_to "used timeslots (hours)", report_on_statistics_path("event_timeslot_sum")
+ %li= link_to "event numbers by track", report_on_statistics_path("events_by_track")

0 comments on commit 8362894

Please sign in to comment.