Skip to content

Commit 20f0a2d

Browse files
feat: Adds support for digital-only hackathons (#395)
* feat: Adds support for digital-only hackathons * fix: Provides clarity for what is removed from digital hackathons Co-authored-by: Peter Kos <[email protected]>
1 parent 5591a92 commit 20f0a2d

File tree

10 files changed

+126
-87
lines changed

10 files changed

+126
-87
lines changed

app/views/application/_questionnaire_summary.html.haml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
%p
1515
%b Resume:
1616
= @questionnaire.resume.attached? ? link_to("Download &raquo;".html_safe, @questionnaire.resume) : 'Not provided'
17-
%p
18-
%b Traveling from:
19-
= @questionnaire.travel_not_from_school ? "Somewhere else (#{@questionnaire.travel_location})" : "My school (#{@questionnaire.school.full_name})"
17+
- if !HackathonConfig['digital_hackathon']
18+
%p
19+
%b Traveling from:
20+
= @questionnaire.travel_not_from_school ? "Somewhere else (#{@questionnaire.travel_location})" : "My school (#{@questionnaire.school.full_name})"
2021
%p
2122
%b Shirt size:
2223
= @questionnaire.shirt_size

app/views/layouts/manage/application.html.haml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,11 @@
8181
%span
8282
= t(:travel, scope: 'layouts.manage.navigation')
8383
%ul.nav.flex-column.mb-2
84-
%li.nav-item
85-
= active_link_to manage_bus_lists_path, class: "nav-link" do
86-
.fa.fa-bus.fa-fw.icon-space-r-half
87-
= t(:title, scope: 'pages.manage.bus-lists')
84+
- if !HackathonConfig['digital_hackathon']
85+
%li.nav-item
86+
= active_link_to manage_bus_lists_path, class: "nav-link" do
87+
.fa.fa-bus.fa-fw.icon-space-r-half
88+
= t(:title, scope: 'pages.manage.bus-lists')
8889
%li.nav-item
8990
= active_link_to manage_schools_path, class: "nav-link" do
9091
.fa.fa-home.fa-fw.icon-space-r-half

app/views/manage/dashboard/index.html.haml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,16 @@
2929
.row
3030
.col
3131
%h5.dashboard-container-title Check-in activity
32-
.graph-overlay.double-metrics
33-
%h3= Questionnaire.where('checked_in_at > 0').count
34-
%p total checked in
35-
%h3= Questionnaire.where('boarded_bus_at > 0').count
36-
%p total boarded bus
32+
- if !HackathonConfig['digital_hackathon']
33+
.graph-overlay.double-metrics
34+
%h3= Questionnaire.where('checked_in_at > 0').count
35+
%p total checked in
36+
%h3= Questionnaire.where('boarded_bus_at > 0').count
37+
%p total boarded bus
38+
- else
39+
.graph-overlay
40+
%h3= Questionnaire.where('checked_in_at > 0').count
41+
%p total checked in
3742
= area_chart checkin_activity_data_manage_dashboard_index_path, colors: [blue, grey], library: { legend: { enabled: false } }
3843

3944
.row

app/views/manage/questionnaires/_form.html.haml

Lines changed: 59 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,48 @@
2323
= f.input :major, input_html: { "data-validate" => "presence" }
2424
= f.input :gender, input_html: { "data-validate" => "presence" }
2525

26+
- if !HackathonConfig['digital_hackathon']
27+
.card.mb-4
28+
.card-header Travel information
29+
.card-body
30+
- travel_state = [email protected]_record? && @questionnaire.travel_not_from_school
31+
= f.input :travel_not_from_school, label: "I will not be traveling from my school"
32+
= f.input :travel_location, input_html: { "data-validate" => "presence", disabled: !travel_state }, wrapper_html: { style: travel_state ? "" : "display: none" }, label: "Travel Location"
33+
34+
= f.association :bus_list, label: "Bus list", include_blank: 'Not travelling on a sponsored bus'
35+
= f.input :boarded_bus, as: :boolean, label: "Boarded bus", input_html: { checked: @questionnaire.boarded_bus_at.present? }
36+
= f.input :is_bus_captain, label: "Is Bus Captain"
37+
- else
38+
.card.mb-4
39+
.card-header Agreements
40+
.card-body
41+
.supporting-text
42+
Please read the
43+
= link_to asset_url(HackathonConfig['agreement_pdf_asset']), target: '_blank' do
44+
#{HackathonConfig['name']} Agreement
45+
%span.fa.fa-external-link.icon-space-l-half
46+
= f.input :agreement_accepted, label: "I accept the #{HackathonConfig['name']} agreement.", input_html: { "data-validate" => "presence" }
47+
48+
.supporting-text
49+
Please read the
50+
%a{ href:"http://static.mlh.io/docs/mlh-code-of-conduct.pdf", target: "_blank" }
51+
MLH Code of Conduct
52+
%span.fa.fa-external-link.icon-space-l-half
53+
= f.input :code_of_conduct_accepted, label: "I accept the MLH Code of Conduct.", input_html: { "data-validate" => "presence" }
54+
55+
.supporting-text
56+
I agree to the terms of both the
57+
<a href="https://github.com/MLH/mlh-policies/tree/master/prize-terms-and-conditions" target="_blank">MLH Contest Terms</a> and Conditions and the
58+
<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.
59+
= f.input :data_sharing_accepted, label: "I accept the MLH policies.", input_html: { "data-validate" => "presence" }
60+
2661
.col-xl-6
2762
.card.mb-4
2863
.card-header Special notices
2964
.card-body
3065
= f.input :shirt_size, as: :select, collection: Questionnaire::POSSIBLE_SHIRT_SIZES, include_blank: "(select one...)", input_html: { "data-validate" => "presence" }
31-
= f.input :dietary_restrictions, label: "Dietary restrictions"
66+
- if !HackathonConfig['digital_hackathon']
67+
= f.input :dietary_restrictions, label: "Dietary restrictions"
3268
= f.input :special_needs, label: "Special needs"
3369
.card.mb-4
3470
.card-header Resume
@@ -49,41 +85,30 @@
4985

5086
= f.input :can_share_info, label: "Share resume with employers?"
5187

52-
.col-xl-6
53-
.card.mb-4
54-
.card-header Travel information
55-
.card-body
56-
- travel_state = [email protected]_record? && @questionnaire.travel_not_from_school
57-
= f.input :travel_not_from_school, label: "I will not be traveling from my school"
58-
= f.input :travel_location, input_html: { "data-validate" => "presence", disabled: !travel_state }, wrapper_html: { style: travel_state ? "" : "display: none" }, label: "Travel Location"
88+
- if !HackathonConfig['digital_hackathon']
89+
.col-xl-12
90+
.card.mb-4
91+
.card-header Agreements
92+
.card-body
93+
.supporting-text
94+
Please read the
95+
= link_to asset_url(HackathonConfig['agreement_pdf_asset']), target: '_blank' do
96+
#{HackathonConfig['name']} Agreement
97+
%span.fa.fa-external-link.icon-space-l-half
98+
= f.input :agreement_accepted, label: "I accept the #{HackathonConfig['name']} agreement.", input_html: { "data-validate" => "presence" }
5999

60-
= f.association :bus_list, label: "Bus list", include_blank: 'Not travelling on a sponsored bus'
61-
= f.input :boarded_bus, as: :boolean, label: "Boarded bus", input_html: { checked: @questionnaire.boarded_bus_at.present? }
62-
= f.input :is_bus_captain, label: "Is Bus Captain"
100+
.supporting-text
101+
Please read the
102+
%a{ href:"http://static.mlh.io/docs/mlh-code-of-conduct.pdf", target: "_blank" }
103+
MLH Code of Conduct
104+
%span.fa.fa-external-link.icon-space-l-half
105+
= f.input :code_of_conduct_accepted, label: "I accept the MLH Code of Conduct.", input_html: { "data-validate" => "presence" }
63106
64-
.col-xl-6
65-
.card.mb-4
66-
.card-header Agreements
67-
.card-body
68-
.supporting-text
69-
Please read the
70-
= link_to asset_url(HackathonConfig['agreement_pdf_asset']), target: '_blank' do
71-
#{HackathonConfig['name']} Agreement
72-
%span.fa.fa-external-link.icon-space-l-half
73-
= f.input :agreement_accepted, label: "I accept the #{HackathonConfig['name']} agreement.", input_html: { "data-validate" => "presence" }
74-
75-
.supporting-text
76-
Please read the
77-
%a{ href:"http://static.mlh.io/docs/mlh-code-of-conduct.pdf", target: "_blank" }
78-
MLH Code of Conduct
79-
%span.fa.fa-external-link.icon-space-l-half
80-
= f.input :code_of_conduct_accepted, label: "I accept the MLH Code of Conduct.", input_html: { "data-validate" => "presence" }
81-
82-
.supporting-text
83-
I agree to the terms of both the
84-
<a href="https://github.com/MLH/mlh-policies/tree/master/prize-terms-and-conditions" target="_blank">MLH Contest Terms</a> and Conditions and the
85-
<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.
86-
= f.input :data_sharing_accepted, label: "I accept the MLH policies.", input_html: { "data-validate" => "presence" }
107+
.supporting-text
108+
I agree to the terms of both the
109+
<a href="https://github.com/MLH/mlh-policies/tree/master/prize-terms-and-conditions" target="_blank">MLH Contest Terms</a> and Conditions and the
110+
<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.
111+
= f.input :data_sharing_accepted, label: "I accept the MLH policies.", input_html: { "data-validate" => "presence" }
87112
88113
.center.mb-4
89114
= f.button :submit, value: ( @questionnaire.new_record? ? 'Create' : 'Save' ), class: 'btn-primary'

app/views/manage/questionnaires/_overview.html.haml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,31 @@
4747
= @questionnaire.special_needs
4848
- else
4949
%span.text-muted (none)
50-
%dt.col-md-4 Bus list
51-
%dd.col-md-8
50+
- if !HackathonConfig['digital_hackathon']
51+
%dt.col-md-4 Bus list
52+
%dd.col-md-8
53+
- if @questionnaire.bus_list_id?
54+
= link_to @questionnaire.bus_list.name, manage_bus_list_path(@questionnaire.bus_list_id)
55+
- else
56+
%span.text-muted (none)
5257
- if @questionnaire.bus_list_id?
53-
= link_to @questionnaire.bus_list.name, manage_bus_list_path(@questionnaire.bus_list_id)
54-
- else
55-
%span.text-muted (none)
56-
- if @questionnaire.bus_list_id?
57-
%dt.col-md-4 Boarded bus?
58+
%dt.col-md-4 Boarded bus?
59+
%dd.col-md-8
60+
- if @questionnaire.boarded_bus?
61+
Yes
62+
- else
63+
No
64+
%dt.col-md-4 Bus captain
5865
%dd.col-md-8
59-
- if @questionnaire.boarded_bus?
60-
Yes
66+
- if @questionnaire.is_bus_captain?
67+
%strong.text-danger Is bus captain
68+
- elsif @questionnaire.bus_captain_interest?
69+
%strong.text-success Interested in being a captain
6170
- else
62-
No
63-
%dt.col-md-4 Bus captain
64-
%dd.col-md-8
65-
- if @questionnaire.is_bus_captain?
66-
%strong.text-danger Is bus captain
67-
- elsif @questionnaire.bus_captain_interest?
68-
%strong.text-success Interested in being a captain
69-
- else
70-
%span.text-muted No
71-
%dt.col-md-4 Traveling from
72-
%dd.col-md-8
73-
= @questionnaire.travel_not_from_school ? "Somewhere else (#{@questionnaire.travel_location})" : "<span class=\"text-muted\">My school</span>".html_safe
71+
%span.text-muted No
72+
%dt.col-md-4 Traveling from
73+
%dd.col-md-8
74+
= @questionnaire.travel_not_from_school ? "Somewhere else (#{@questionnaire.travel_location})" : "<span class=\"text-muted\">My school</span>".html_safe
7475

7576
.card.mb-3
7677
.card-header Resume

app/views/manage/stats/index.html.haml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,22 @@
1717
%th Special Needs
1818
%tbody
1919
20-
.row
21-
.col
22-
%h5.dashboard-container-title Attendees Not Traveling From Their School
23-
%table.datatable.stats-notschooltravel.table.table-striped.table-hover{ "data-source" => alt_travel_datatable_manage_stats_path(format: :json) }
24-
%thead
25-
%tr
26-
%th ID
27-
%th First Name
28-
%th Last Name
29-
%th Email
30-
%th Phone
31-
%th Questionnaire
32-
%th Traveling From
33-
%th Questionnaire Status
34-
%tbody
20+
- if !HackathonConfig['digital_hackathon']
21+
.row
22+
.col
23+
%h5.dashboard-container-title Attendees Not Traveling From Their School
24+
%table.datatable.stats-notschooltravel.table.table-striped.table-hover{ "data-source" => alt_travel_datatable_manage_stats_path(format: :json) }
25+
%thead
26+
%tr
27+
%th ID
28+
%th First Name
29+
%th Last Name
30+
%th Email
31+
%th Phone
32+
%th Questionnaire
33+
%th Traveling From
34+
%th Questionnaire Status
35+
%tbody
3536
3637
.row
3738
.col

app/views/questionnaires/_form.html.haml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@
3636
= 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"
3737
= 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"
3838

39-
- travel_state = [email protected]_record? && @questionnaire.travel_not_from_school
40-
= f.input :travel_not_from_school, as: :radio_buttons, collection: { " My school" => false, " Somewhere else" => true }, label: "I am traveling from..."
41-
= 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"
39+
- if !HackathonConfig['digital_hackathon']
40+
- travel_state = [email protected]_record? && @questionnaire.travel_not_from_school
41+
= f.input :travel_not_from_school, as: :radio_buttons, collection: { " My school" => false, " Somewhere else" => true }, label: "I am traveling from..."
42+
= 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"
4243

4344
= f.input :shirt_size, as: :select, collection: Questionnaire::POSSIBLE_SHIRT_SIZES, include_blank: "(select one...)", input_html: { "data-validate" => "presence" }
44-
= f.input :dietary_restrictions, as: :text, label: "Health restrictions", wrapper_html: { class: 'input--half' }, maxlength: Questionnaire::DIETARY_SPECIAL_NEEDS_MAX_LENGTH
45+
46+
- if !HackathonConfig['digital_hackathon']
47+
= f.input :dietary_restrictions, as: :text, label: "Health restrictions", wrapper_html: { class: 'input--half' }, maxlength: Questionnaire::DIETARY_SPECIAL_NEEDS_MAX_LENGTH
4548
= f.input :special_needs, as: :text, label: "Special needs", wrapper_html: { class: 'input--half' }, maxlength: Questionnaire::DIETARY_SPECIAL_NEEDS_MAX_LENGTH
4649

4750
%hr

app/views/rsvps/show.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
= f.button :submit, value: "Update"
4242

43-
- if BusList.any?
43+
- if BusList.any? && !HackathonConfig['digital_hackathon']
4444
.form-container.hide-if-not-attending{ style: @questionnaire.acc_status == "rsvp_denied" ? "display: none;" : "" }
4545
#disclaimer
4646
%h1.section-title

config/app.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ defaults: &defaults
33

44
# Logic config
55
accepting_questionnaires: true
6+
digital_hackathon: false
67
last_day_to_apply: "<%= Date.new(2000, 1, 1).to_s %>"
78
event_start_date: "<%= Date.new(2000, 1, 1).to_s %>"
89
auto_late_waitlist: false

config/locales/en.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ en:
5656
is_home: The "home" school is separated from all other schools on dashboard metrics.
5757
hackathon_config:
5858
accepting_questionnaires: Specify and allow questionnaires to be accepted.
59+
digital_hackathon: Optimize HackathonManager for a digital hackathon. (Removes travel, dietary restrictions, etc.)
5960
last_day_to_apply: 'Last date to apply to your hackathon (format: YYYY-MM-DD)'
6061
event_start_date: 'Start date of your hackathon (format: YYYY-MM-DD)'
6162
auto_late_waitlist: Automatically set application status to "late waitlist" for new applications

0 commit comments

Comments
 (0)