Updated the gems, add missing migration for the stats controller, fix most obvious issues with stats

This commit is contained in:
Henne Vogelsang 2013-10-22 15:52:29 +02:00
parent 52d1785a7c
commit 8aeeabebab
7 changed files with 124 additions and 101 deletions

View file

@ -12,7 +12,7 @@
//
//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require jquery.ui.all
//= require jquery-fileupload
//= require jquery-ui-timepicker-addon
//= require jquery.dataTables

View file

@ -28,20 +28,22 @@ class Admin::StatsController < ApplicationController
@mydays = []
@mytickets = []
(@conference.registration_start_date..@conference.end_date).each do |day|
day_reg_count = @registrations.where("created_at LIKE '%#{day}%' ").count
day_ticket_count = @tickets.where("supporter_registrations.created_at LIKE '%#{day}%' ").count
if day_reg_count != 0
@mydays << {"status" => "#{day}", "value" => day_reg_count}
end
@conference.supporter_levels.each do |level|
day_ticket_count = @tickets.where("supporter_registrations.created_at LIKE ? AND supporter_levels.title LIKE ?", "%#{day}%", "%#{level.title}%").count
if day_ticket_count !=0
@mytickets << {"status" => "#{day}", "ticket" => "#{level}", "value" => day_ticket_count}
if @conference.registration_start_date and @conference.end_date
(@conference.registration_start_date..@conference.end_date).each do |day|
day_reg_count = @registrations.where("created_at LIKE '%#{day}%' ").count
day_ticket_count = @tickets.where("supporter_registrations.created_at LIKE '%#{day}%' ").count
if day_reg_count != 0
@mydays << {"status" => "#{day}", "value" => day_reg_count}
end
@conference.supporter_levels.each do |level|
day_ticket_count = @tickets.where("supporter_registrations.created_at LIKE ? AND supporter_levels.title LIKE ?", "%#{day}%", "%#{level.title}%").count
if day_ticket_count !=0
@mytickets << {"status" => "#{day}", "ticket" => "#{level}", "value" => day_ticket_count}
end
end
end
end
@other_info = [
{"status" => "with partner (registered)", "value" => @registered_with_partner},
{"status" => "with partner (attended)", "value" => @attended_with_partner},

View file

@ -1,6 +1,9 @@
.row-fluid
.span4
%h4{:style => "text-indent: 25px"}= "Registrations - Attendees (#{(@attendees.to_f / @registered * 100).round}%)"
- if @attendees > 0
%h4{:style => "text-indent: 25px"}= "Registrations - Attendees (#{(@attendees.to_f / @registered * 100).round }%)"
- else
%h4{:style => "text-indent: 25px"}= "Registrations - Attendees"
.row-fluid
.span12#registrations_attendees