app/views/manage/dashboard/index.html.haml in hackathon_manager-0.10.1 vs app/views/manage/dashboard/index.html.haml in hackathon_manager-0.10.2

- old
+ new

@@ -49,22 +49,24 @@ = pie_chart user_distribution_data_manage_dashboard_index_path, colors: [grey, blue, orange] .col %h5.dashboard-container-title Application Distribution = pie_chart application_distribution_data_manage_dashboard_index_path, colors: [colors[:pending], colors[:accepted], colors[:waitlisted], colors[:denied], colors[:late_waitlist], colors[:rsvp_confirmed], colors[:rsvp_denied]] -.row - .col - %h5.dashboard-container-title Schools (Confirmed) - %ul - = bar_chart schools_confirmed_data_manage_dashboard_index_path, height: "600px", stacked: true, colors: [blue, orange] +- if Questionnaire.where(acc_status: 'rsvp_confirmed').count > 0 + .row + .col + %h5.dashboard-container-title Schools (Confirmed) + %ul + = bar_chart schools_confirmed_data_manage_dashboard_index_path, height: "600px", stacked: true, colors: [blue, orange] -.row - .col - %h5.dashboard-container-title Schools (Applied) - %ul - = bar_chart schools_applied_data_manage_dashboard_index_path, height: "600px", stacked: true, colors: [colors[:rsvp_confirmed], colors[:accepted], colors[:waitlist], colors[:late_waitlist], colors[:rsvp_denied], colors[:denied], colors[:pending]], library: { legend: { enabled: false } } - - if School.where("questionnaire_count >= 1 AND questionnaire_count < 5").count > 0 - %p - %button.btn.btn-light{ onclick: "$('#least-applied-schools').toggle()" }= "List schools with < 5 applicants" - %ul#least-applied-schools{ style: "display: none" } - - School.where("questionnaire_count >= 1 AND questionnaire_count < 5").select([:name, :questionnaire_count]).order("questionnaire_count DESC").each do |school| - %li= "#{school.questionnaire_count} - #{school.name}" +- if Questionnaire.count > 0 + .row + .col + %h5.dashboard-container-title Schools (Applied) + %ul + = bar_chart schools_applied_data_manage_dashboard_index_path, height: "600px", stacked: true, colors: [colors[:rsvp_confirmed], colors[:accepted], colors[:waitlist], colors[:late_waitlist], colors[:rsvp_denied], colors[:denied], colors[:pending]], library: { legend: { enabled: false } } + - if School.where("questionnaire_count >= 5").count > 0 && School.where("questionnaire_count < 5").count > 0 + %p + %button.btn.btn-light{ onclick: "$('#least-applied-schools').toggle()" }= "List schools with < 5 applicants" + %ul#least-applied-schools{ style: "display: none" } + - School.where("questionnaire_count >= 1 AND questionnaire_count < 5").select([:name, :questionnaire_count]).order("questionnaire_count DESC").each do |school| + %li= "#{school.questionnaire_count} - #{school.name}"