Skip to content

Commit

Permalink
add report for speaker attendance.
Browse files Browse the repository at this point in the history
  • Loading branch information
manno committed Oct 13, 2013
1 parent 595e643 commit 11d5745
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
18 changes: 18 additions & 0 deletions app/controllers/reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,24 @@ def show_statistics
events = @conference.events.where(event_type: :workshops)
row << @conference.event_duration_sum(events)
@data << row
@search_count = nil

when 'people_speaking_by_day'
@data = []
row = []
@labels = %w{Day FullName PublicName Email Event Role State} # TODO translate

@conference.days.each do |day|
@conference.events.confirmed.no_conflicts.public.scheduled_on(day).order(:start_time).each do |event|
event.event_people.presenter.each do |event_person|
person = event_person.person
row = [ l(day.date), person.full_name, person.public_name, person.email, event.title, event_person.event_role, event_person.role_state ]
@data << row
end
end
end

@search_count = nil
end

render :show
Expand Down
2 changes: 1 addition & 1 deletion app/models/event_person.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class EventPerson < ActiveRecord::Base
include UniqueToken

ROLES = [:coordinator, :submitter, :speaker, :moderator]
STATES = [:canceled, :confirmed, :declined, :idea, :offer, :unclear]
STATES = [:canceled, :confirmed, :declined, :idea, :offer, :unclear, :attending]

belongs_to :event
belongs_to :person
Expand Down
1 change: 1 addition & 0 deletions app/views/reports/_report_menu.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
%li= link_to "used timeslots (hours)", report_on_statistics_path("event_timeslot_sum")
%li= link_to "confirmed event numbers by track", report_on_statistics_path("confirmed_events_by_track")
%li= link_to "event numbers by track", report_on_statistics_path("events_by_track")
%li= link_to "confirmed speakers by day with attendance status", report_on_statistics_path("people_speaking_by_day")
10 changes: 6 additions & 4 deletions app/views/reports/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
%h1 Available Reports
= render 'report_menu'
%h2 Results
= render 'shared/simple_search', :path => request.path
Found
= @search_count
results.
- if @people or @events
= render 'shared/simple_search', :path => request.path
- unless @search_count.nil?
Found
= @search_count
results.
- if not @people.nil? and not @people.empty?
.row
.span16
Expand Down

0 comments on commit 11d5745

Please sign in to comment.