Getting rid of plain sql in stats_controller

This commit is contained in:
Ancor Gonzalez Sosa 2013-07-16 15:50:32 +02:00
parent 26236424cc
commit 7e930d8d40
2 changed files with 10 additions and 30 deletions

View file

@ -1,7 +1,7 @@
.row-fluid
.span12
%h3
Non-free Tickets (#{@tickets.length if @tickets}#{0 unless @tickets})
Non-free Tickets (#{@tickets})
.row-fluid
.span5
- if @supporter_levels.count > 0
@ -11,18 +11,18 @@
%th #
%th %
- @supporter_levels.each do |level|
- reg_support = reg_support(level)
- if reg_support.count > 0
- reg_count = level.supporter_registrations.count
- if reg_count > 0
%tr
%td= level.title
%td
= reg_support.count
= reg_count
%td
- if @registered and @registered > 0
= "#{reg_support.count * 100 / @registered}% of registered"
= "#{reg_count * 100 / @registered}% of registered"
- if @attendees and @attendees > 0
%br
= "#{reg_support.count * 100 / @attendees}% of attendees"
= "#{reg_count * 100 / @attendees}% of attendees"
- else
%p
No tickets sold yet
No tickets sold yet