diff --git a/app/views/admin/stats/_registrations.html.haml b/app/views/admin/stats/_registrations.html.haml index 8f487e9e..bda3f06c 100644 --- a/app/views/admin/stats/_registrations.html.haml +++ b/app/views/admin/stats/_registrations.html.haml @@ -26,42 +26,42 @@ %tr %td Staying at suggested hotel: %td= @conference.registrations.where("using_affiliated_lodging = ?", true).count - - if @conference.use_dietary_choices == true - - diet_choices = [] - - @conference.dietary_choices.each do |d| - - count = @conference.registrations.where("dietary_choice_id = ?", d.id).count - - if count > 0 - - diet_choices << [d.title, count] + +- if @conference.use_dietary_choices == true + - diet_choices = [] + - @conference.dietary_choices.each do |d| + - count = @conference.registrations.where("dietary_choice_id = ?", d.id).count + - if count > 0 + - diet_choices << [d.title, count] - if diet_choices.any? - .span4 - %table.table.table-bordered.table-striped - %thead - %th Dietary Choice - %th # - %th Percentage - - diet_choices.each do |d| - %tr - %td= d[0] - %td= d[1] - %td - - if @registered and @registered > 0 - = "#{d[1] * 100 / @registered}% of registered" - - if @attendees and @attendees > 0 - %br - = "#{d[1] * 100 / @attendees}% of attendees" - - if @conference.social_events.count > 0 - - social_events = [] - - @conference.social_events.each do |social_event| - - count = @conference.registrations.joins(:social_events).where("registrations_social_events.social_event_id = ?", social_event.id).count - - if count > 0 - - social_events << [social_event.title, count] - - if social_events.any? - .span4 - %table.table.table-bordered.table-striped - %thead - %th Social Event - %th # - - social_events.each do |s| - %tr - %td= s[0] - %td= s[1] \ No newline at end of file + %table.table.table-bordered.table-striped + %thead + %th Dietary Choice + %th # + %th Percentage + - diet_choices.each do |d| + %tr + %td= d[0] + %td= d[1] + %td + - if @registered and @registered > 0 + = "#{d[1] * 100 / @registered}% of registered" + - if @attendees and @attendees > 0 + %br + = "#{d[1] * 100 / @attendees}% of attendees" + +- if @conference.social_events.count > 0 + - social_events = [] + - @conference.social_events.each do |social_event| + - count = @conference.registrations.joins(:social_events).where("registrations_social_events.social_event_id = ?", social_event.id).count + - if count > 0 + - social_events << [social_event.title, count] + - if social_events.any? + %table.table.table-bordered.table-striped + %thead + %th Social Event + %th # + - social_events.each do |s| + %tr + %td= s[0] + %td= s[1] \ No newline at end of file