Merge branch 'statistics' of github.com:differentreality/osem into differentreality-statistics

This commit is contained in:
Ancor Gonzalez Sosa 2013-07-16 15:43:22 +02:00
commit 45b95584e0
4 changed files with 117 additions and 90 deletions

View file

@ -21,10 +21,21 @@ class Admin::StatsController < ApplicationController
@speaker_fields_reg = %w[with_partner need_access other_needs diet arrival departure]
@supporter_levels = @conference.supporter_levels
@tickets = @conference.registrations.find_by_sql("select *
from registrations inner join supporter_registrations
ON registrations.id = supporter_registrations.registration_id
inner join supporter_levels
ON supporter_levels.id = supporter_registrations.supporter_level_id
where registrations.conference_id = #{@conference.id}")
end
def reg_support(level)
Registration.find_by_sql("select supporter_registrations.* FROM registrations, supporter_registrations, supporter_levels WHERE registrations.id = supporter_registrations.registration_id AND registrations.conference_id = #{@conference.id} AND supporter_registrations.supporter_level_id = #{level.id}")
Registration.find_by_sql("select supporter_registrations.*
FROM registrations INNER JOIN supporter_registrations
ON registrations.id = supporter_registrations.registration_id
WHERE registrations.conference_id = #{@conference.id}
AND supporter_registrations.supporter_level_id = #{level.id}")
end
def speaker_reg(speaker)

View file

@ -1,9 +1,13 @@
.row-fluid
.span12
%h3
Registered
- if @registered
= "(#{@registered})"
- if @attendees
= " - Attendees (#{@attendees})"
.row-fluid
.span3
%table.table.table-bordered.table-striped
%thead
%th General Stats
@ -21,12 +25,13 @@
%td Registred to attend with partner
%td= @registered_with_partner
%tr
%td Handicapped Access for:
%td Handicapped Access for
%td= @conference.registrations.where("handicapped_access_required = ?", true).count
%tr
%td Staying at suggested hotel:
%td Staying at suggested hotel
%td= @conference.registrations.where("using_affiliated_lodging = ?", true).count
.span3
- if @conference.use_dietary_choices == true
- diet_choices = []
- @conference.dietary_choices.each do |d|
@ -49,7 +54,7 @@
- if @attendees and @attendees > 0
%br
= "#{d[1] * 100 / @attendees}% of attendees"
.span3
- if @conference.social_events.count > 0
- social_events = []
- @conference.social_events.each do |social_event|

View file

@ -1,7 +1,7 @@
- count =0
%h3
Speakers (#{@speakers.length})
%table.table.table-striped.table-bordered.table-hover#events
%table.table.table-striped.table-bordered.table-hover#speakertable
%thead
%th
ID
@ -34,3 +34,10 @@
= getdatetime(reg, field)
- else
= reg.send(field.to_sym)
:javascript
$(document).ready(function(){
$('#speakertable').dataTable({
"bPaginate": false
});
});

View file

@ -1,5 +1,9 @@
.row-fluid
.span12
%h3
Tickets (#{@tickets.length if @tickets}#{0 unless @tickets})
Non-free Tickets (#{@tickets.length if @tickets}#{0 unless @tickets})
.row-fluid
.span5
- if @supporter_levels.count > 0
%table.table.table-bordered.table-striped
%thead