hackathon_manager 0.12.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/hackathon_manager/application.js +2 -0
- data/app/controllers/manage/questionnaires_controller.rb +1 -1
- data/app/datatables/questionnaire_datatable.rb +10 -1
- data/app/views/application/_bus_list_stats.html.haml +19 -8
- data/app/views/layouts/hackathon_manager/application.html.haml +1 -1
- data/app/views/manage/bus_lists/show.html.haml +5 -2
- data/app/views/manage/questionnaires/_form.html.haml +1 -1
- data/app/views/manage/questionnaires/_overview.html.haml +14 -0
- data/lib/hackathon_manager/version.rb +1 -1
- metadata +1 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 38ec6a89224e9425dbbf6a08e05dc282517ce6a9ecf6c5905967c7a71acbdd62
         | 
| 4 | 
            +
              data.tar.gz: 461e4c1c853153cade1c635e92939e8f4207b06c13b39a5ba5559110d14beeb6
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 787250f12418e9824e8a87ea77d026116623e4b1d56c5f1e1d00dbe2a43d94393adc48326e55590514ed7f08eb9fe0f4cf0e72277e8fc3085159b1f00b246633
         | 
| 7 | 
            +
              data.tar.gz: a8572e718b57f1c3bc45b1854e9b6f9bf4a3b6c5b22b78c52069c0f277fd71e751fe7fb6386b7d4f92f459184eb0edc45c2e36e49597d536a8d587f78f078227
         | 
| @@ -149,7 +149,7 @@ class Manage::QuestionnairesController < Manage::ApplicationController | |
| 149 149 | 
             
                  :phone, :can_share_info, :code_of_conduct_accepted,
         | 
| 150 150 | 
             
                  :travel_not_from_school, :travel_location, :data_sharing_accepted,
         | 
| 151 151 | 
             
                  :graduation_year, :race_ethnicity, :resume, :delete_resume, :why_attend,
         | 
| 152 | 
            -
                  :is_bus_captain
         | 
| 152 | 
            +
                  :bus_list_id, :is_bus_captain
         | 
| 153 153 | 
             
                )
         | 
| 154 154 | 
             
              end
         | 
| 155 155 |  | 
| @@ -22,12 +22,21 @@ class QuestionnaireDatatable < AjaxDatatablesRails::Base | |
| 22 22 |  | 
| 23 23 | 
             
              private
         | 
| 24 24 |  | 
| 25 | 
            +
              def note(record)
         | 
| 26 | 
            +
                output = ''
         | 
| 27 | 
            +
                output += '<i class="fa fa-exclamation-triangle icon-space-r"></i> <small>Minor</small>' if record.minor?
         | 
| 28 | 
            +
                output += '<i class="fa fa-bus icon-space-r" title="Bus Captain"></i>' if record.bus_list_id?
         | 
| 29 | 
            +
                output += '<small>Captain</small>' if record.is_bus_captain?
         | 
| 30 | 
            +
                output = '<div class="center">' + output + '</div>' if output.present?
         | 
| 31 | 
            +
                output.html_safe
         | 
| 32 | 
            +
              end
         | 
| 33 | 
            +
             | 
| 25 34 | 
             
              def data
         | 
| 26 35 | 
             
                records.map do |record|
         | 
| 27 36 | 
             
                  {
         | 
| 28 37 | 
             
                    bulk: current_user.admin_limited_access ? '' : "<input type=\"checkbox\" data-bulk-row-edit=\"#{record.id}\">".html_safe,
         | 
| 29 38 | 
             
                    link: link_to('<i class="fa fa-search"></i>'.html_safe, manage_questionnaire_path(record)),
         | 
| 30 | 
            -
                    note: record | 
| 39 | 
            +
                    note: note(record),
         | 
| 31 40 | 
             
                    id: record.id,
         | 
| 32 41 | 
             
                    first_name: bold(record.first_name),
         | 
| 33 42 | 
             
                    last_name: bold(record.last_name),
         | 
| @@ -1,9 +1,20 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
             | 
| 3 | 
            -
              = pluralize(accepted, 'person has', 'people have')
         | 
| 4 | 
            -
              been accepted but not yet RSVP'd.
         | 
| 1 | 
            +
            - passengers = Questionnaire.joins(:school).group('schools.name').where(acc_status: 'rsvp_confirmed', bus_list_id: @bus_list.id).order("schools.name ASC").count
         | 
| 2 | 
            +
            = pie_chart passengers
         | 
| 5 3 |  | 
| 6 | 
            -
            % | 
| 7 | 
            -
             | 
| 8 | 
            -
             | 
| 9 | 
            -
               | 
| 4 | 
            +
            %br
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            :ruby
         | 
| 7 | 
            +
              school_ids = Questionnaire.where(acc_status: 'rsvp_confirmed', bus_list_id: @bus_list.id).distinct.pluck(:school_id)
         | 
| 8 | 
            +
              schools = Questionnaire.joins(:school).group('schools.name').where(school_id: school_ids, acc_status: 'rsvp_confirmed').order("schools.name ASC").count
         | 
| 9 | 
            +
              schools_riding = Questionnaire.joins(:school).group('schools.name').where(school_id: school_ids, acc_status: 'rsvp_confirmed', bus_list_id: @bus_list.id).count
         | 
| 10 | 
            +
              schools = schools.map do |name, count|
         | 
| 11 | 
            +
                bus_count_row = schools_riding.select { |school_bus_name, _| school_bus_name == name }
         | 
| 12 | 
            +
                bus_count = bus_count_row ? bus_count_row[name] || 0 : 0
         | 
| 13 | 
            +
                count_without_bus = count - bus_count
         | 
| 14 | 
            +
                [name, count_without_bus, bus_count]
         | 
| 15 | 
            +
              end
         | 
| 16 | 
            +
              data = [
         | 
| 17 | 
            +
                { name: "Attending but not riding this bus", data: schools.sort_by { |_, no_bus, bus| [bus, no_bus] }.reverse },
         | 
| 18 | 
            +
                { name: "Riding this bus", data: schools_riding }
         | 
| 19 | 
            +
              ]
         | 
| 20 | 
            +
            = bar_chart data, stacked: true, height: '400px'
         | 
| @@ -15,10 +15,10 @@ | |
| 15 15 | 
             
                = render "layouts/hackathon_manager/header"
         | 
| 16 16 | 
             
                = render "layouts/hackathon_manager/account_nav"
         | 
| 17 17 | 
             
                = render "layouts/hackathon_manager/flashes"
         | 
| 18 | 
            +
                = javascript_include_tag "hackathon_manager/application"
         | 
| 18 19 | 
             
                #main
         | 
| 19 20 | 
             
                  %section.section
         | 
| 20 21 | 
             
                    .container
         | 
| 21 22 | 
             
                      = yield
         | 
| 22 23 | 
             
                = render "layouts/hackathon_manager/footer"
         | 
| 23 | 
            -
                = javascript_include_tag "hackathon_manager/application"
         | 
| 24 24 | 
             
                = render "layouts/hackathon_manager/shared_footer"
         | 
| @@ -109,5 +109,8 @@ | |
| 109 109 | 
             
                              - else
         | 
| 110 110 | 
             
                                = link_to "Make Bus Captain", toggle_bus_captain_manage_bus_list_path(@bus_list, questionnaire_id: p.id, bus_captain: '1'), method: 'post', data: { confirm: 'Are you sure? This will send a confirmation email to the bus captain.' }
         | 
| 111 111 |  | 
| 112 | 
            -
             | 
| 113 | 
            -
             | 
| 112 | 
            +
            .row.mt-2.mb-4
         | 
| 113 | 
            +
              .col
         | 
| 114 | 
            +
                %h4.border-bottom.pb-2.mb-4
         | 
| 115 | 
            +
                  Passenger Distribution
         | 
| 116 | 
            +
                = render partial: 'bus_list_stats', locals: { bus_list: @bus_list }
         | 
| @@ -48,7 +48,7 @@ | |
| 48 48 | 
             
                  = f.input :travel_not_from_school, label: "I will not be traveling from my school"
         | 
| 49 49 | 
             
                  = f.input :travel_location, input_html: { "data-validate" => "presence", disabled: !travel_state }, wrapper_html: { style: travel_state ? "" : "display: none" }, label: "Travel Location"
         | 
| 50 50 |  | 
| 51 | 
            -
                  = f. | 
| 51 | 
            +
                  = f.association :bus_list, label: "Bus list", include_blank: 'Not travelling on a sponsored bus'
         | 
| 52 52 | 
             
                  = f.input :is_bus_captain, label: "Is Bus Captain"
         | 
| 53 53 |  | 
| 54 54 | 
             
                %hr
         | 
| @@ -95,6 +95,20 @@ | |
| 95 95 | 
             
                          = @questionnaire.special_needs
         | 
| 96 96 | 
             
                        - else
         | 
| 97 97 | 
             
                          %span.text-muted (none)
         | 
| 98 | 
            +
                      %dt.col-md-4 Bus list
         | 
| 99 | 
            +
                      %dd.col-md-8
         | 
| 100 | 
            +
                        - if @questionnaire.bus_list_id?
         | 
| 101 | 
            +
                          = link_to @questionnaire.bus_list.name, manage_bus_list_path(@questionnaire.bus_list_id)
         | 
| 102 | 
            +
                        - else
         | 
| 103 | 
            +
                          %span.text-muted (none)
         | 
| 104 | 
            +
                      %dt.col-md-4 Bus captain
         | 
| 105 | 
            +
                      %dd.col-md-8
         | 
| 106 | 
            +
                        - if @questionnaire.is_bus_captain?
         | 
| 107 | 
            +
                          %strong.text-danger Is bus captain
         | 
| 108 | 
            +
                        - elsif @questionnaire.bus_captain_interest?
         | 
| 109 | 
            +
                          %strong.text-success Interested in being a captain
         | 
| 110 | 
            +
                        - else
         | 
| 111 | 
            +
                          %span.text-muted No
         | 
| 98 112 | 
             
                      %dt.col-md-4 Traveling from
         | 
| 99 113 | 
             
                      %dd.col-md-8
         | 
| 100 114 | 
             
                        = @questionnaire.travel_not_from_school ? "Somewhere else (#{@questionnaire.travel_location})" : "<span class=\"text-muted\">My school</span>".html_safe
         |