diff --git a/app/views/application/_questionnaire_summary.html.haml b/app/views/application/_questionnaire_summary.html.haml index 8a6f22959..fbd0660ee 100644 --- a/app/views/application/_questionnaire_summary.html.haml +++ b/app/views/application/_questionnaire_summary.html.haml @@ -14,9 +14,10 @@ %p %b Resume: = @questionnaire.resume.attached? ? link_to("Download »".html_safe, @questionnaire.resume) : 'Not provided' -%p - %b Traveling from: - = @questionnaire.travel_not_from_school ? "Somewhere else (#{@questionnaire.travel_location})" : "My school (#{@questionnaire.school.full_name})" +- if !HackathonConfig['digital_hackathon'] + %p + %b Traveling from: + = @questionnaire.travel_not_from_school ? "Somewhere else (#{@questionnaire.travel_location})" : "My school (#{@questionnaire.school.full_name})" %p %b Shirt size: = @questionnaire.shirt_size diff --git a/app/views/layouts/manage/application.html.haml b/app/views/layouts/manage/application.html.haml index 98b542311..cf40dc171 100644 --- a/app/views/layouts/manage/application.html.haml +++ b/app/views/layouts/manage/application.html.haml @@ -81,10 +81,11 @@ %span = t(:travel, scope: 'layouts.manage.navigation') %ul.nav.flex-column.mb-2 - %li.nav-item - = active_link_to manage_bus_lists_path, class: "nav-link" do - .fa.fa-bus.fa-fw.icon-space-r-half - = t(:title, scope: 'pages.manage.bus-lists') + - if !HackathonConfig['digital_hackathon'] + %li.nav-item + = active_link_to manage_bus_lists_path, class: "nav-link" do + .fa.fa-bus.fa-fw.icon-space-r-half + = t(:title, scope: 'pages.manage.bus-lists') %li.nav-item = active_link_to manage_schools_path, class: "nav-link" do .fa.fa-home.fa-fw.icon-space-r-half diff --git a/app/views/manage/dashboard/index.html.haml b/app/views/manage/dashboard/index.html.haml index 574d2b775..c0642f5e3 100644 --- a/app/views/manage/dashboard/index.html.haml +++ b/app/views/manage/dashboard/index.html.haml @@ -29,11 +29,16 @@ .row .col %h5.dashboard-container-title Check-in activity - .graph-overlay.double-metrics - %h3= Questionnaire.where('checked_in_at > 0').count - %p total checked in - %h3= Questionnaire.where('boarded_bus_at > 0').count - %p total boarded bus + - if !HackathonConfig['digital_hackathon'] + .graph-overlay.double-metrics + %h3= Questionnaire.where('checked_in_at > 0').count + %p total checked in + %h3= Questionnaire.where('boarded_bus_at > 0').count + %p total boarded bus + - else + .graph-overlay + %h3= Questionnaire.where('checked_in_at > 0').count + %p total checked in = area_chart checkin_activity_data_manage_dashboard_index_path, colors: [blue, grey], library: { legend: { enabled: false } } .row diff --git a/app/views/manage/questionnaires/_form.html.haml b/app/views/manage/questionnaires/_form.html.haml index b52c22783..7d245df4b 100644 --- a/app/views/manage/questionnaires/_form.html.haml +++ b/app/views/manage/questionnaires/_form.html.haml @@ -23,12 +23,48 @@ = f.input :major, input_html: { "data-validate" => "presence" } = f.input :gender, input_html: { "data-validate" => "presence" } + - if !HackathonConfig['digital_hackathon'] + .card.mb-4 + .card-header Travel information + .card-body + - travel_state = !@questionnaire.new_record? && @questionnaire.travel_not_from_school + = f.input :travel_not_from_school, label: "I will not be traveling from my school" + = f.input :travel_location, input_html: { "data-validate" => "presence", disabled: !travel_state }, wrapper_html: { style: travel_state ? "" : "display: none" }, label: "Travel Location" + + = f.association :bus_list, label: "Bus list", include_blank: 'Not travelling on a sponsored bus' + = f.input :boarded_bus, as: :boolean, label: "Boarded bus", input_html: { checked: @questionnaire.boarded_bus_at.present? } + = f.input :is_bus_captain, label: "Is Bus Captain" + - else + .card.mb-4 + .card-header Agreements + .card-body + .supporting-text + Please read the + = link_to asset_url(HackathonConfig['agreement_pdf_asset']), target: '_blank' do + #{HackathonConfig['name']} Agreement + %span.fa.fa-external-link.icon-space-l-half + = f.input :agreement_accepted, label: "I accept the #{HackathonConfig['name']} agreement.", input_html: { "data-validate" => "presence" } + + .supporting-text + Please read the + %a{ href:"http://static.mlh.io/docs/mlh-code-of-conduct.pdf", target: "_blank" } + MLH Code of Conduct + %span.fa.fa-external-link.icon-space-l-half + = f.input :code_of_conduct_accepted, label: "I accept the MLH Code of Conduct.", input_html: { "data-validate" => "presence" } + + .supporting-text + I agree to the terms of both the + MLH Contest Terms and Conditions and the + MLH Privacy Policy. Please note that you may receive pre and post-event informational e-mails and occasional messages about hackathons from MLH as per the MLH Privacy Policy. + = f.input :data_sharing_accepted, label: "I accept the MLH policies.", input_html: { "data-validate" => "presence" } + .col-xl-6 .card.mb-4 .card-header Special notices .card-body = f.input :shirt_size, as: :select, collection: Questionnaire::POSSIBLE_SHIRT_SIZES, include_blank: "(select one...)", input_html: { "data-validate" => "presence" } - = f.input :dietary_restrictions, label: "Dietary restrictions" + - if !HackathonConfig['digital_hackathon'] + = f.input :dietary_restrictions, label: "Dietary restrictions" = f.input :special_needs, label: "Special needs" .card.mb-4 .card-header Resume @@ -49,41 +85,30 @@ = f.input :can_share_info, label: "Share resume with employers?" - .col-xl-6 - .card.mb-4 - .card-header Travel information - .card-body - - travel_state = !@questionnaire.new_record? && @questionnaire.travel_not_from_school - = f.input :travel_not_from_school, label: "I will not be traveling from my school" - = f.input :travel_location, input_html: { "data-validate" => "presence", disabled: !travel_state }, wrapper_html: { style: travel_state ? "" : "display: none" }, label: "Travel Location" + - if !HackathonConfig['digital_hackathon'] + .col-xl-12 + .card.mb-4 + .card-header Agreements + .card-body + .supporting-text + Please read the + = link_to asset_url(HackathonConfig['agreement_pdf_asset']), target: '_blank' do + #{HackathonConfig['name']} Agreement + %span.fa.fa-external-link.icon-space-l-half + = f.input :agreement_accepted, label: "I accept the #{HackathonConfig['name']} agreement.", input_html: { "data-validate" => "presence" } - = f.association :bus_list, label: "Bus list", include_blank: 'Not travelling on a sponsored bus' - = f.input :boarded_bus, as: :boolean, label: "Boarded bus", input_html: { checked: @questionnaire.boarded_bus_at.present? } - = f.input :is_bus_captain, label: "Is Bus Captain" + .supporting-text + Please read the + %a{ href:"http://static.mlh.io/docs/mlh-code-of-conduct.pdf", target: "_blank" } + MLH Code of Conduct + %span.fa.fa-external-link.icon-space-l-half + = f.input :code_of_conduct_accepted, label: "I accept the MLH Code of Conduct.", input_html: { "data-validate" => "presence" } - .col-xl-6 - .card.mb-4 - .card-header Agreements - .card-body - .supporting-text - Please read the - = link_to asset_url(HackathonConfig['agreement_pdf_asset']), target: '_blank' do - #{HackathonConfig['name']} Agreement - %span.fa.fa-external-link.icon-space-l-half - = f.input :agreement_accepted, label: "I accept the #{HackathonConfig['name']} agreement.", input_html: { "data-validate" => "presence" } - - .supporting-text - Please read the - %a{ href:"http://static.mlh.io/docs/mlh-code-of-conduct.pdf", target: "_blank" } - MLH Code of Conduct - %span.fa.fa-external-link.icon-space-l-half - = f.input :code_of_conduct_accepted, label: "I accept the MLH Code of Conduct.", input_html: { "data-validate" => "presence" } - - .supporting-text - I agree to the terms of both the - MLH Contest Terms and Conditions and the - MLH Privacy Policy. Please note that you may receive pre and post-event informational e-mails and occasional messages about hackathons from MLH as per the MLH Privacy Policy. - = f.input :data_sharing_accepted, label: "I accept the MLH policies.", input_html: { "data-validate" => "presence" } + .supporting-text + I agree to the terms of both the + MLH Contest Terms and Conditions and the + MLH Privacy Policy. Please note that you may receive pre and post-event informational e-mails and occasional messages about hackathons from MLH as per the MLH Privacy Policy. + = f.input :data_sharing_accepted, label: "I accept the MLH policies.", input_html: { "data-validate" => "presence" } .center.mb-4 = f.button :submit, value: ( @questionnaire.new_record? ? 'Create' : 'Save' ), class: 'btn-primary' diff --git a/app/views/manage/questionnaires/_overview.html.haml b/app/views/manage/questionnaires/_overview.html.haml index 5e410bbf4..84e579a26 100644 --- a/app/views/manage/questionnaires/_overview.html.haml +++ b/app/views/manage/questionnaires/_overview.html.haml @@ -47,30 +47,31 @@ = @questionnaire.special_needs - else %span.text-muted (none) - %dt.col-md-4 Bus list - %dd.col-md-8 + - if !HackathonConfig['digital_hackathon'] + %dt.col-md-4 Bus list + %dd.col-md-8 + - if @questionnaire.bus_list_id? + = link_to @questionnaire.bus_list.name, manage_bus_list_path(@questionnaire.bus_list_id) + - else + %span.text-muted (none) - if @questionnaire.bus_list_id? - = link_to @questionnaire.bus_list.name, manage_bus_list_path(@questionnaire.bus_list_id) - - else - %span.text-muted (none) - - if @questionnaire.bus_list_id? - %dt.col-md-4 Boarded bus? + %dt.col-md-4 Boarded bus? + %dd.col-md-8 + - if @questionnaire.boarded_bus? + Yes + - else + No + %dt.col-md-4 Bus captain %dd.col-md-8 - - if @questionnaire.boarded_bus? - Yes + - if @questionnaire.is_bus_captain? + %strong.text-danger Is bus captain + - elsif @questionnaire.bus_captain_interest? + %strong.text-success Interested in being a captain - else - No - %dt.col-md-4 Bus captain - %dd.col-md-8 - - if @questionnaire.is_bus_captain? - %strong.text-danger Is bus captain - - elsif @questionnaire.bus_captain_interest? - %strong.text-success Interested in being a captain - - else - %span.text-muted No - %dt.col-md-4 Traveling from - %dd.col-md-8 - = @questionnaire.travel_not_from_school ? "Somewhere else (#{@questionnaire.travel_location})" : "My school".html_safe + %span.text-muted No + %dt.col-md-4 Traveling from + %dd.col-md-8 + = @questionnaire.travel_not_from_school ? "Somewhere else (#{@questionnaire.travel_location})" : "My school".html_safe .card.mb-3 .card-header Resume diff --git a/app/views/manage/stats/index.html.haml b/app/views/manage/stats/index.html.haml index 310caa9de..7451827a2 100644 --- a/app/views/manage/stats/index.html.haml +++ b/app/views/manage/stats/index.html.haml @@ -17,21 +17,22 @@ %th Special Needs %tbody -.row - .col - %h5.dashboard-container-title Attendees Not Traveling From Their School - %table.datatable.stats-notschooltravel.table.table-striped.table-hover{ "data-source" => alt_travel_datatable_manage_stats_path(format: :json) } - %thead - %tr - %th ID - %th First Name - %th Last Name - %th Email - %th Phone - %th Questionnaire - %th Traveling From - %th Questionnaire Status - %tbody +- if !HackathonConfig['digital_hackathon'] + .row + .col + %h5.dashboard-container-title Attendees Not Traveling From Their School + %table.datatable.stats-notschooltravel.table.table-striped.table-hover{ "data-source" => alt_travel_datatable_manage_stats_path(format: :json) } + %thead + %tr + %th ID + %th First Name + %th Last Name + %th Email + %th Phone + %th Questionnaire + %th Traveling From + %th Questionnaire Status + %tbody .row .col diff --git a/app/views/questionnaires/_form.html.haml b/app/views/questionnaires/_form.html.haml index b895acebe..3aa07a83a 100644 --- a/app/views/questionnaires/_form.html.haml +++ b/app/views/questionnaires/_form.html.haml @@ -36,12 +36,15 @@ = f.input :resume, as: :deletable_attachment, hint: "Must be a PDF, under 2MB", input_html: { "data-validate" => "file-max-size file-content-type", "data-validate-file-max-size" => "2097152", "data-validate-file-content-type" => "application/pdf" }, label: "Resume" = f.input :can_share_info, as: :radio_buttons, collection: { " Yes please!" => true, " No, thank you." => false }, label: "Share info with sponsors?", hint: "Our sponsors would receive info such as your name, email, resume, GitHub link, etc" - - travel_state = !@questionnaire.new_record? && @questionnaire.travel_not_from_school - = f.input :travel_not_from_school, as: :radio_buttons, collection: { " My school" => false, " Somewhere else" => true }, label: "I am traveling from..." - = f.input :travel_location, input_html: { "data-validate" => "presence", disabled: !travel_state }, wrapper_html: { style: travel_state ? "" : "display: none" }, label: "Where are you traveling from?", placeholder: "New York City" + - if !HackathonConfig['digital_hackathon'] + - travel_state = !@questionnaire.new_record? && @questionnaire.travel_not_from_school + = f.input :travel_not_from_school, as: :radio_buttons, collection: { " My school" => false, " Somewhere else" => true }, label: "I am traveling from..." + = f.input :travel_location, input_html: { "data-validate" => "presence", disabled: !travel_state }, wrapper_html: { style: travel_state ? "" : "display: none" }, label: "Where are you traveling from?", placeholder: "New York City" = f.input :shirt_size, as: :select, collection: Questionnaire::POSSIBLE_SHIRT_SIZES, include_blank: "(select one...)", input_html: { "data-validate" => "presence" } - = f.input :dietary_restrictions, as: :text, label: "Health restrictions", wrapper_html: { class: 'input--half' }, maxlength: Questionnaire::DIETARY_SPECIAL_NEEDS_MAX_LENGTH + + - if !HackathonConfig['digital_hackathon'] + = f.input :dietary_restrictions, as: :text, label: "Health restrictions", wrapper_html: { class: 'input--half' }, maxlength: Questionnaire::DIETARY_SPECIAL_NEEDS_MAX_LENGTH = f.input :special_needs, as: :text, label: "Special needs", wrapper_html: { class: 'input--half' }, maxlength: Questionnaire::DIETARY_SPECIAL_NEEDS_MAX_LENGTH %hr diff --git a/app/views/rsvps/show.html.haml b/app/views/rsvps/show.html.haml index c1348cf02..810f35b45 100644 --- a/app/views/rsvps/show.html.haml +++ b/app/views/rsvps/show.html.haml @@ -40,7 +40,7 @@ = f.button :submit, value: "Update" - - if BusList.any? + - if BusList.any? && !HackathonConfig['digital_hackathon'] .form-container.hide-if-not-attending{ style: @questionnaire.acc_status == "rsvp_denied" ? "display: none;" : "" } #disclaimer %h1.section-title diff --git a/config/app.yml b/config/app.yml index 23057decb..4a2da5bd5 100644 --- a/config/app.yml +++ b/config/app.yml @@ -3,6 +3,7 @@ defaults: &defaults # Logic config accepting_questionnaires: true + digital_hackathon: false last_day_to_apply: "<%= Date.new(2000, 1, 1).to_s %>" event_start_date: "<%= Date.new(2000, 1, 1).to_s %>" auto_late_waitlist: false diff --git a/config/locales/en.yml b/config/locales/en.yml index 4e641763c..2a40ac20d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -56,6 +56,7 @@ en: is_home: The "home" school is separated from all other schools on dashboard metrics. hackathon_config: accepting_questionnaires: Specify and allow questionnaires to be accepted. + digital_hackathon: Optimize HackathonManager for a digital hackathon. (Removes travel, dietary restrictions, etc.) last_day_to_apply: 'Last date to apply to your hackathon (format: YYYY-MM-DD)' event_start_date: 'Start date of your hackathon (format: YYYY-MM-DD)' auto_late_waitlist: Automatically set application status to "late waitlist" for new applications