Commit f2d1322e authored by ponder's avatar ponder

#108

parent 72a48110
......@@ -44,6 +44,7 @@ gem 'sucker_punch'
gem 'transitions', :require => ["transitions", "active_record/transitions"]
gem 'will_paginate'
gem 'wicked', github: "schneems/wicked", branch: 'master'
gem 'comma', '~> 3.2.1'
group :development, :test do
gem 'bullet'
......
......@@ -92,6 +92,8 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.9.1.1)
comma (3.2.4)
activesupport (>= 3.0.0)
database_cleaner (1.5.1)
debase (0.2.1)
debase-ruby_core_source
......@@ -252,6 +254,7 @@ DEPENDENCIES
cancancan
cocoon
coffee-rails (~> 4.1.0)
comma (~> 3.2.1)
database_cleaner
debase
dotenv-rails
......
......@@ -81,6 +81,30 @@ class ReportsController < ApplicationController
r = conference_people.involved_in(@conference).where(Person.arel_table[:note].not_eq(""))
when 'people_with_more_than_one'
r = conference_people.involved_in(@conference).where("event_people.event_role" => ["submitter"]).group('event_people.person_id').having('count(*) > 1')
when /^all_submitter_|^ss_submitter|^ip_submitter/
case @report_type
when /^all_submitter_/
r = conference_people.submitter_in(@conference)
when /^ss_submitter_/
r = conference_people.special_session_submitter_in(@conference)
when /^ip_submitter_/
r = conference_people.individual_paper_submitter_in(@conference)
else
puts 'i should not be reached.'
end
case @report_type
when /_submitter_unfinished$/
r = r.where('events.state' => 'new')
when /_submitter_finished$/
r = r.where('events.state' => 'submission_finished')
when /_submitter_review$/
r = r.where('events.state' => 'review')
when /_submitter_accepted$/
r = r.where('events.state' => 'unconfirmed')
when /_submitter_rejected$/
r = r.where('events.state' => 'rejected')
end
end
unless r.nil? or r.empty?
......@@ -90,6 +114,7 @@ class ReportsController < ApplicationController
end
respond_to do |format|
format.html { render :show }
format.csv { render :csv => r, style: :name_email}
end
end
......
......@@ -61,6 +61,12 @@ class Person < ActiveRecord::Base
scope :submitter_in, ->(conference) {
joins(events: :conference).where('conferences.id' => conference.id).where('event_people.event_role' => 'submitter')
}
scope :special_session_submitter_in, ->(conference) {
submitter_in(conference).where('events.event_type' => ['Academic Special Session', 'Research in Action Special Session'])
}
scope :individual_paper_submitter_in, ->(conference) {
submitter_in(conference).where('events.event_type' => 'Individual Paper')
}
scope :contributor_in, ->(conference) {
joins(events: :conference).where('conferences.id' => conference.id).where('event_people.event_role' => 'session_contributor')
}
......@@ -68,6 +74,11 @@ class Person < ActiveRecord::Base
joins(:user).where('users.role' => 'admin')
}
comma :name_email do
full_name 'Name'
email
end
def full_name
if first_name.blank? or last_name.blank?
......
......@@ -9,8 +9,86 @@
%li= link_to 'events with a note', report_on_events_path('events_with_a_note')
%li= link_to 'events without speaker', report_on_events_path('events_without_speaker')
%li= link_to 'events with speakers in a problematic state', report_on_events_path('events_with_unusual_state_speakers')
%li= link_to 'events with 'do not record' flag set', report_on_events_path('do_not_record_events')
%li= link_to 'events with \'do not record\' flag set', report_on_events_path('do_not_record_events')
%li= link_to 'list all lectures with non default timeslots', report_on_events_path('event_timeslot_deviation')
%p Query All Submitters
%ul
%li
= succeed ', ' do
= link_to 'all', report_on_people_path('all_submitter_all')
= link_to '(as csv)', report_on_people_path('all_submitter_all', format: :csv)
%li
= succeed ', ' do
= link_to 'with unfinished submissions', report_on_people_path('all_submitter_unfinished')
= link_to '(as csv)', report_on_people_path('all_submitter_unfinished', format: :csv)
%li
= succeed ', ' do
= link_to 'with finished submissions', report_on_people_path('all_submitter_finished')
= link_to '(as csv)', report_on_people_path('all_submitter_finished', format: :csv)
%li
= succeed ', ' do
= link_to 'with submissions in review', report_on_people_path('all_submitter_review')
= link_to '(as csv)', report_on_people_path('all_submitter_in_review', format: :csv)
%li
= succeed ', ' do
= link_to 'with accepted submissions', report_on_people_path('all_submitter_accepted')
= link_to '(as csv)', report_on_people_path('all_submitter_accepted', format: :csv)
%li
= succeed ', ' do
= link_to 'with rejected submissions', report_on_people_path('all_submitted_rejected')
= link_to '(as csv)', report_on_people_path('all_submitter_rejected', format: :csv)
%p Query Special Session Submitters
%ul
%li
= succeed ', ' do
= link_to 'all', report_on_people_path('ss_submitter_all')
= link_to '(as csv)', report_on_people_path('ss_submitter_all', format: :csv)
%li
= succeed ', ' do
= link_to 'with unfinished submissions', report_on_people_path('ss_submitter_unfinished')
= link_to '(as csv)', report_on_people_path('ss_submitter_unfinished', format: :csv)
%li
= succeed ', ' do
= link_to 'with finished submissions', report_on_people_path('ss_submitter_finished')
= link_to '(as csv)', report_on_people_path('ss_submitter_finished', format: :csv)
%li
= succeed ', ' do
= link_to 'with submissions in review', report_on_people_path('ss_submitter_review')
= link_to '(as csv)', report_on_people_path('ss_submitter_in_review', format: :csv)
%li
= succeed ', ' do
= link_to 'with accepted submissions', report_on_people_path('ss_submitter_accepted')
= link_to '(as csv)', report_on_people_path('ss_submitter_accepted', format: :csv)
%li
= succeed ', ' do
= link_to 'with rejected submissions', report_on_people_path('ss_submitted_rejected')
= link_to '(as csv)', report_on_people_path('ss_submitter_rejected', format: :csv)
%p Query Individual Paper Submitters
%ul
%li
= succeed ', ' do
= link_to 'all', report_on_people_path('ip_submitter_all')
= link_to '(as csv)', report_on_people_path('ip_submitter_all', format: :csv)
%li
= succeed ', ' do
= link_to 'with unfinished submissions', report_on_people_path('ip_submitter_unfinished')
= link_to '(as csv)', report_on_people_path('ip_submitter_unfinished', format: :csv)
%li
= succeed ', ' do
= link_to 'with finished submissions', report_on_people_path('ip_submitter_finished')
= link_to '(as csv)', report_on_people_path('ip_submitter_finished', format: :csv)
%li
= succeed ', ' do
= link_to 'with submissions in review', report_on_people_path('ip_submitter_review')
= link_to '(as csv)', report_on_people_path('ip_submitter_in_review', format: :csv)
%li
= succeed ', ' do
= link_to 'with accepted submissions', report_on_people_path('ip_submitter_accepted')
= link_to '(as csv)', report_on_people_path('ip_submitter_accepted', format: :csv)
%li
= succeed ', ' do
= link_to 'with rejected submissions', report_on_people_path('ip_submitted_rejected')
= link_to '(as csv)', report_on_people_path('ip_submitter_rejected', format: :csv)
%p Query Speakers
%ul
%li= link_to 'missing speakers for the next 4 hours', report_on_people_path('expected_speakers')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment