Add new page with organizer reports
This commit is contained in:
parent
8335aa8b43
commit
fabe29d2ed
4 changed files with 108 additions and 1 deletions
|
|
@ -5,7 +5,7 @@ module Admin
|
||||||
load_and_authorize_resource :event, through: :program
|
load_and_authorize_resource :event, through: :program
|
||||||
load_and_authorize_resource :events_registration, only: :toggle_attendance
|
load_and_authorize_resource :events_registration, only: :toggle_attendance
|
||||||
|
|
||||||
before_action :get_event, except: [:index, :create]
|
before_action :get_event, except: [:index, :create, :reports]
|
||||||
|
|
||||||
# FIXME: The timezome should only be applied on output, otherwise
|
# FIXME: The timezome should only be applied on output, otherwise
|
||||||
# you get lost in timezone conversions...
|
# you get lost in timezone conversions...
|
||||||
|
|
@ -139,6 +139,13 @@ module Admin
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def reports
|
||||||
|
@events = @program.events
|
||||||
|
@events_commercials = Commercial.where(commercialable_type: 'Event', commercialable_id: @events.pluck(:id))
|
||||||
|
@events_missing_commercial = @events.where.not(id: @events_commercials.pluck(:commercialable_id))
|
||||||
|
@events_with_requirements = @events.where.not(description: ['', nil])
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def event_params
|
def event_params
|
||||||
|
|
|
||||||
96
app/views/admin/events/reports.html.haml
Normal file
96
app/views/admin/events/reports.html.haml
Normal file
|
|
@ -0,0 +1,96 @@
|
||||||
|
.tabbable
|
||||||
|
%ul.nav.nav-tabs
|
||||||
|
%li.active
|
||||||
|
= link_to 'All Events', '#all', 'data-toggle' => 'tab'
|
||||||
|
%li
|
||||||
|
%a{href: '#missing-commercial', 'data-toggle' => 'tab'}
|
||||||
|
Events without Commercials
|
||||||
|
%span.label.label-danger{style: 'border-radius: 1em;'}
|
||||||
|
= @events_missing_commercial.length
|
||||||
|
%li
|
||||||
|
%a{href: '#requirements', 'data-toggle' => 'tab'}
|
||||||
|
Speaker Requirements
|
||||||
|
%span.label.label-success{style: 'border-radius: 1em;'}
|
||||||
|
= @events_with_requirements.length
|
||||||
|
|
||||||
|
.tab-content
|
||||||
|
#all.tab-pane.active
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
.page-header
|
||||||
|
%h1
|
||||||
|
All Events
|
||||||
|
= "(#{@events.length})"
|
||||||
|
%p.text-muted
|
||||||
|
All submissions and the information that they are mssing
|
||||||
|
|
||||||
|
.col-md-12
|
||||||
|
%table.table.table-striped.table-bordered.table-hover.datatable
|
||||||
|
%thead
|
||||||
|
%th Title
|
||||||
|
%th Submitter Registered
|
||||||
|
%th Submitter Biography
|
||||||
|
%th Commercial
|
||||||
|
%th Subtitle
|
||||||
|
%th Difficulty Level
|
||||||
|
- if @program.tracks.any?
|
||||||
|
%th Track
|
||||||
|
%tbody
|
||||||
|
- @events.each do |event|
|
||||||
|
%tr
|
||||||
|
- progress_status = event.progress_status
|
||||||
|
%td
|
||||||
|
= link_to event.title, edit_conference_program_proposal_path(@conference.short_title, event)
|
||||||
|
%br
|
||||||
|
.small (Presented by #{event.speaker_names})
|
||||||
|
|
||||||
|
- %w(registered biography commercials subtitle difficulty_level).each do |info|
|
||||||
|
%td{'data-order' => "#{progress_status[info]}"}
|
||||||
|
%span{class: class_for_todo(progress_status[info])}
|
||||||
|
%span{class: [icon_for_todo(progress_status[info]), 'fa-lg']}
|
||||||
|
- if @program.tracks.any?
|
||||||
|
%td{'data-order' => "#{progress_status['track']}"}
|
||||||
|
%span{class: class_for_todo(progress_status['track'])}
|
||||||
|
%span{class: [icon_for_todo(progress_status['track']), 'fa-lg']}
|
||||||
|
|
||||||
|
#missing-commercial.tab-pane
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
.page-header
|
||||||
|
%h1
|
||||||
|
Events without commercials
|
||||||
|
= "(#{@events_missing_commercial.length})"
|
||||||
|
%p.text-muted
|
||||||
|
All submissions that have no commercial
|
||||||
|
.col-md-12
|
||||||
|
%table.table.table-striped.table-bordered.table-hover.datatable
|
||||||
|
%thead
|
||||||
|
%th Title
|
||||||
|
%th Speaker(s)
|
||||||
|
%tbody
|
||||||
|
- @events_missing_commercial.each do |event|
|
||||||
|
%tr
|
||||||
|
%td= link_to event.title, edit_conference_program_proposal_path(@conference.short_title, event)
|
||||||
|
%td #{event.speaker_names}
|
||||||
|
|
||||||
|
#requirements.tab-pane
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
.page-header
|
||||||
|
%h1
|
||||||
|
Requirements
|
||||||
|
= "(#{@events_with_requirements.length})"
|
||||||
|
%p.text-muted
|
||||||
|
All submissions where the speakers have special requirements
|
||||||
|
.col-md-12
|
||||||
|
%table.table.table-striped.table-bordered.table-hover.datatable
|
||||||
|
%thead
|
||||||
|
%th Title
|
||||||
|
%th Speaker(s)
|
||||||
|
%th Requirements
|
||||||
|
%tbody
|
||||||
|
- @events_with_requirements.each do |event|
|
||||||
|
%tr
|
||||||
|
%td= link_to event.title, edit_conference_program_proposal_path(@conference.short_title, event)
|
||||||
|
%td #{event.speaker_names}
|
||||||
|
%td= event.description
|
||||||
|
|
@ -84,6 +84,9 @@
|
||||||
- if can? :update, @conference.program.schedules.build
|
- if can? :update, @conference.program.schedules.build
|
||||||
%li{class: active_nav_li(admin_conference_schedules_path(@conference.short_title))}
|
%li{class: active_nav_li(admin_conference_schedules_path(@conference.short_title))}
|
||||||
= link_to 'Schedules', admin_conference_schedules_path(@conference.short_title)
|
= link_to 'Schedules', admin_conference_schedules_path(@conference.short_title)
|
||||||
|
- if can? :update, @conference.program.events.build
|
||||||
|
%li{:class=> active_nav_li(reports_admin_conference_program_path(@conference.short_title))}
|
||||||
|
= link_to 'Reports', reports_admin_conference_program_path(@conference.short_title)
|
||||||
|
|
||||||
- if can? :update, Registration.new(conference_id: @conference.id)
|
- if can? :update, Registration.new(conference_id: @conference.id)
|
||||||
%li{:class=> active_nav_li(admin_conference_registrations_path(@conference.short_title))}
|
%li{:class=> active_nav_li(admin_conference_registrations_path(@conference.short_title))}
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ Osem::Application.routes.draw do
|
||||||
get :vote
|
get :vote
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
get 'reports' => 'events#reports'
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :tickets
|
resources :tickets
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue