Skip to content

feat: Adds support for digital-only hackathons #395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions app/views/application/_questionnaire_summary.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions app/views/layouts/manage/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 10 additions & 5 deletions app/views/manage/dashboard/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
93 changes: 59 additions & 34 deletions app/views/manage/questionnaires/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [email protected]_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
<a href="https://github.com/MLH/mlh-policies/tree/master/prize-terms-and-conditions" target="_blank">MLH Contest Terms</a> and Conditions and the
<a href="https://mlh.io/privacy" target="_blank">MLH Privacy Policy</a>. 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
Expand All @@ -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 = [email protected]_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
<a href="https://github.com/MLH/mlh-policies/tree/master/prize-terms-and-conditions" target="_blank">MLH Contest Terms</a> and Conditions and the
<a href="https://mlh.io/privacy" target="_blank">MLH Privacy Policy</a>. 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
<a href="https://github.com/MLH/mlh-policies/tree/master/prize-terms-and-conditions" target="_blank">MLH Contest Terms</a> and Conditions and the
<a href="https://mlh.io/privacy" target="_blank">MLH Privacy Policy</a>. 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'
43 changes: 22 additions & 21 deletions app/views/manage/questionnaires/_overview.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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})" : "<span class=\"text-muted\">My school</span>".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})" : "<span class=\"text-muted\">My school</span>".html_safe

.card.mb-3
.card-header Resume
Expand Down
31 changes: 16 additions & 15 deletions app/views/manage/stats/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions app/views/questionnaires/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [email protected]_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 = [email protected]_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
Expand Down
2 changes: 1 addition & 1 deletion app/views/rsvps/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions config/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down