hackathon_manager 0.13.12 → 0.14.0

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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/hackathon_manager/manage/application.js +0 -2
  3. data/app/assets/javascripts/hackathon_manager/manage/lib/datatables.js +3 -3
  4. data/app/assets/javascripts/hackathon_manager/vendor/datatables.min.js +89 -74
  5. data/app/assets/stylesheets/hackathon_manager/datatables.min.css +3 -3
  6. data/app/assets/stylesheets/hackathon_manager/manage.sass +3 -3
  7. data/app/controllers/manage/admins_controller.rb +1 -0
  8. data/app/controllers/manage/configs_controller.rb +31 -3
  9. data/app/controllers/manage/questionnaires_controller.rb +3 -3
  10. data/app/controllers/questionnaires_controller.rb +1 -1
  11. data/app/controllers/rsvps_controller.rb +1 -1
  12. data/app/mailers/application_mailer.rb +1 -1
  13. data/app/mailers/mailer.rb +2 -2
  14. data/app/models/hackathon_config.rb +7 -0
  15. data/app/models/questionnaire.rb +1 -1
  16. data/app/models/user.rb +2 -0
  17. data/app/views/application/_questionnaire_summary.html.haml +1 -1
  18. data/app/views/bus_lists/show.html.haml +2 -2
  19. data/app/views/devise/registrations/new.html.haml +5 -5
  20. data/app/views/devise/sessions/new.html.haml +1 -1
  21. data/app/views/layouts/hackathon_manager/_header.html.haml +2 -2
  22. data/app/views/layouts/hackathon_manager/application.html.haml +3 -3
  23. data/app/views/layouts/mailer.html.erb +1 -1
  24. data/app/views/layouts/manage/application.html.haml +6 -6
  25. data/app/views/mailer/bus_captain_confirmation_email.html.erb +3 -3
  26. data/app/views/mailer/incomplete_reminder_email.html.erb +2 -2
  27. data/app/views/manage/configs/edit.html.haml +17 -0
  28. data/app/views/manage/configs/index.html.haml +34 -0
  29. data/app/views/manage/messages/_form.html.haml +1 -1
  30. data/app/views/manage/questionnaires/_form.html.haml +4 -4
  31. data/app/views/manage/questionnaires/_overview.html.haml +1 -1
  32. data/app/views/questionnaires/_form.html.haml +6 -6
  33. data/app/views/questionnaires/new.html.haml +1 -1
  34. data/app/views/questionnaires/show.html.haml +6 -6
  35. data/app/views/rsvps/show.html.haml +3 -3
  36. data/config/app.yml +33 -0
  37. data/config/initializers/devise.rb +1 -1
  38. data/config/locales/en.yml +24 -0
  39. data/config/routes.rb +1 -2
  40. data/db/migrate/20190216203450_create_settings.rb +17 -0
  41. data/db/seed_messages/questionnaire--accepted.md +1 -1
  42. data/db/seed_messages/questionnaire--pending.md +1 -1
  43. data/db/seed_messages/questionnaire--rsvp_confirmed.md +1 -1
  44. data/lib/hackathon_manager.rb +1 -13
  45. data/lib/hackathon_manager/engine.rb +1 -13
  46. data/lib/hackathon_manager/version.rb +1 -1
  47. metadata +26 -9
  48. data/app/views/manage/configs/show.html.haml +0 -27
  49. data/config/initializers/0_hackathon.rb +0 -3
@@ -2,7 +2,7 @@
2
2
  .form-container.login
3
3
  %h1.section-title.center
4
4
  Sign in to
5
- %span.emphasized= Rails.configuration.hackathon['name']
5
+ %span.emphasized= HackathonConfig['name']
6
6
  - if notice
7
7
  .form-success
8
8
  .success_message
@@ -1,9 +1,9 @@
1
1
  .header
2
2
  .header__wrapper.account-nav__wrapper
3
- - if Rails.configuration.hackathon['logo_asset']
3
+ - if HackathonConfig['logo_asset'].present?
4
4
  .header-logo
5
5
  = link_to root_path do
6
- = image_tag Rails.configuration.hackathon['logo_asset'], id: 'logo', alt: "#{Rails.configuration.hackathon['name']} logo", title: Rails.configuration.hackathon['name'], class: 'header-logo__image'
6
+ = image_tag HackathonConfig['logo_asset'], id: 'logo', alt: "#{HackathonConfig['name']} logo", title: HackathonConfig['name'], class: 'header-logo__image'
7
7
  - else
8
8
  .header-nav
9
9
  = btn_link_to "Home", root_path
@@ -1,12 +1,12 @@
1
1
  !!! 5
2
2
  %html
3
3
  %head
4
- %title= yield(:title) || Rails.configuration.hackathon['default_page_title']
4
+ %title= yield(:title) || HackathonConfig['default_page_title']
5
5
  %meta{ charset: "utf-8" }
6
6
  %meta{ name:"viewport", content: "width=device-width, initial-scale=1" }
7
7
 
8
- - if Rails.configuration.hackathon['favicon_asset'].present?
9
- %link{ href: image_url(Rails.configuration.hackathon['favicon_asset']), rel: "shortcut icon" }
8
+ - if HackathonConfig['favicon_asset'].present?
9
+ %link{ href: image_url(HackathonConfig['favicon_asset']), rel: "shortcut icon" }
10
10
 
11
11
  = stylesheet_link_tag "hackathon_manager/core", media: "all"
12
12
  = csrf_meta_tags
@@ -357,7 +357,7 @@
357
357
  <table role="presentation" border="0" cellpadding="0" cellspacing="0">
358
358
  <tr>
359
359
  <td class="content-block">
360
- You received this email because you applied to <%= Rails.configuration.hackathon['name'] %>. <%= link_to 'Manage account', questionnaires_url %>.
360
+ You received this email because you applied to <%= HackathonConfig['name'] %>. <%= link_to 'Manage account', questionnaires_url %>.
361
361
  </td>
362
362
  </tr>
363
363
  <tr>
@@ -1,11 +1,11 @@
1
1
  !!! 5
2
2
  %html
3
3
  %head
4
- %title= yield(:title).presence || "#{Rails.configuration.hackathon['name']} Manager"
4
+ %title= yield(:title).presence || "#{HackathonConfig['name']} Manager"
5
5
  %meta{ content: "width=device-width, initial-scale=1, shrink-to-fit=no", name: "viewport" }/
6
6
 
7
- - if Rails.configuration.hackathon['favicon_asset'].present?
8
- %link{ href: image_url(Rails.configuration.hackathon['favicon_asset']), rel: "shortcut icon" }
7
+ - if HackathonConfig['favicon_asset'].present?
8
+ %link{ href: image_url(HackathonConfig['favicon_asset']), rel: "shortcut icon" }
9
9
 
10
10
  = stylesheet_link_tag "hackathon_manager/manage", :media => "all"
11
11
  = csrf_meta_tags
@@ -14,7 +14,7 @@
14
14
  = javascript_include_tag "hackathon_manager/manage/application"
15
15
 
16
16
  %nav.navbar.navbar-dark.fixed-top.bg-dark.flex-nowrap.p-0.shadow
17
- %a.navbar-brand.col-xs-6.col-sm-3.col-md-2.mr-0{href: manage_root_path} #{Rails.configuration.hackathon['name']} Manager
17
+ %a.navbar-brand.col-xs-6.col-sm-3.col-md-2.mr-0{href: manage_root_path} #{HackathonConfig['name']} Manager
18
18
  / %input.form-control.form-control-dark.w-100{"aria-label" => "Search", placeholder: "Search", type: "text"}/
19
19
  %span.navbar-brand.navbar-mobile-toggle.mr-0.pl-3.pr-3{onclick: 'toggleMobileNav()'}
20
20
  .fa.fa-bars.fa-fw.icon-space-r-half
@@ -68,10 +68,10 @@
68
68
  %span Advanced
69
69
  %ul.nav.flex-column.mb-2
70
70
  %li.nav-item
71
- = active_link_to manage_config_path, class: "nav-link" do
71
+ = active_link_to manage_configs_path, class: "nav-link" do
72
72
  .fa.fa-wrench.fa-fw.icon-space-r-half
73
73
  Config
74
- .nav-item-description View configuration
74
+ .nav-item-description Manage configuration
75
75
  %li.nav-item
76
76
  = active_link_to sidekiq_web_path, target: '_blank', class: "nav-link" do
77
77
  .fa.fa-tasks.fa-fw.icon-space-r-half
@@ -1,6 +1,6 @@
1
1
  <h2>You're a bus captain!</h2>
2
2
  <p>Hey <%= @user.first_name %>,</p>
3
- <p>Thanks for volunteering to be a bus captain! We know most people just want to hop on &amp; off the bus, but coordinating busses isn't that easy. Thanks to you, this bus to <%= Rails.configuration.hackathon['name'] %> can be a success!</p>
3
+ <p>Thanks for volunteering to be a bus captain! We know most people just want to hop on &amp; off the bus, but coordinating busses isn't that easy. Thanks to you, this bus to <%= HackathonConfig['name'] %> can be a success!</p>
4
4
  <p>We've provided a portal to view all bus passengers for your bus, as well as provide important information about being a captain. <strong>Please take a look!</strong></p>
5
5
  <p>
6
6
  <a href="https://brickhack.io/bus_list" class="button" target="_blank">Bus List &raquo;</a>
@@ -8,5 +8,5 @@
8
8
  <small><i>Link not working? Go to <a href="https://brickhack.io/bus_list">brickhack.io/bus_list</a></i></small>
9
9
  </p>
10
10
  <p>This will be the central source of truth for passengers &amp; bus information, in addition to anything you hear from our travel director.</p>
11
- <p>This also means your <strong>name, email, and phone number</strong> are visible to everyone riding the bus. This information is taken straight from your <%= Rails.configuration.hackathon['name'] %> application, so please make sure it is up to date! You can check this at <a href="https://brickhack.io/apply">https://brickhack.io/apply</a></p>
12
- <p>Again, thank you so much for being a bus captain! If you have any questions at all, feel free to reach out. We can't wait to see you at <%= Rails.configuration.hackathon['name'] %>!</p>
11
+ <p>This also means your <strong>name, email, and phone number</strong> are visible to everyone riding the bus. This information is taken straight from your <%= HackathonConfig['name'] %> application, so please make sure it is up to date! You can check this at <a href="https://brickhack.io/apply">https://brickhack.io/apply</a></p>
12
+ <p>Again, thank you so much for being a bus captain! If you have any questions at all, feel free to reach out. We can't wait to see you at <%= HackathonConfig['name'] %>!</p>
@@ -1,6 +1,6 @@
1
1
  <h2>Finish Your Application</h2>
2
- <p>You're almost there! You completed the My MLH part of the application, but didn't finish the additional <%= Rails.configuration.hackathon['name'] %>-specific questions.</p>
2
+ <p>You're almost there! You completed the My MLH part of the application, but didn't finish the additional <%= HackathonConfig['name'] %>-specific questions.</p>
3
3
  <p><strong>Your application will not be considered until it is completed.</strong></p>
4
4
  <p>Not to worry! Just <%= link_to 'head on back to the website', questionnaires_url %>, sign in with your existing My MLH account (if necessary), and complete the application.</p>
5
5
  <p><%= link_to 'Finish Application »', questionnaires_url, class: 'button' %></p>
6
- <p>Happy hacking!<br> - The <%= Rails.configuration.hackathon['name'] %> Team</p>
6
+ <p>Happy hacking!<br> - The <%= HackathonConfig['name'] %> Team</p>
@@ -0,0 +1,17 @@
1
+ = render "layouts/manage/page_title", title: "Edit Configuration", subtitle: @config.var do
2
+ = link_to 'Cancel', manage_configs_path, class: 'btn btn-sm btn-outline-secondary'
3
+
4
+ .form-container
5
+ = bs_horizontal_simple_form_for HackathonConfig, url: manage_config_path(@config.var), method: 'patch', html: { "data-validate" => "form" } do |f|
6
+ = f.error_notification
7
+
8
+ .form-inputs
9
+ - if [true, false].include? @config.value
10
+ -# = f.input :value, label: @config.var, as: :boolean, 'yes', 'no'
11
+ = f.input @config.var.to_sym, as: :radio_buttons, :collection => [['true',true], ['false',false]], label_method: :first, value_method: :last, :prompt => 'Choose one...'
12
+ - else
13
+ = f.input @config.var.to_sym, input_html: { value: @config.value }
14
+
15
+ .form-actions
16
+ = f.button :submit, class: 'btn-primary', value: "Update #{@config.var}"
17
+
@@ -0,0 +1,34 @@
1
+ = render "layouts/manage/page_title", title: "Hackathon Configuration"
2
+
3
+ .row
4
+ .col-lg-6.mb-3
5
+ - @config.each_key do |key|
6
+ .card.mb-3
7
+ .card-body
8
+ %p.mb-1
9
+ = link_to edit_manage_config_path(key), class: 'icon-space-r' do
10
+ %span.fa.fa-pencil
11
+ %b
12
+ = t("simple_form.labels.hackathon_config.#{key}")
13
+ &nbsp;
14
+ %small
15
+ %code= key
16
+ %p.text-muted= t("simple_form.hints.hackathon_config.#{key}").html_safe
17
+ - if @config[key] == ''
18
+ %p.mb-0
19
+ %em
20
+ %small
21
+ &mdash; Not set &mdash;
22
+ - else
23
+ %pre.mb-0= @config[key]
24
+
25
+ .col-lg-6.mb-3
26
+ .card
27
+ .card-body
28
+ %h5.card-title Environment Variables
29
+ %h6.card-subtitle.mb-2.text-muted
30
+ Environment variables are configured on the production server.
31
+ %hr
32
+ %p
33
+ %b AWS S3 Bucket for Resumes:
34
+ %pre= ENV['AWS_BUCKET'] || '[No value]'
@@ -6,7 +6,7 @@
6
6
  = f.input :type, as: :select, collection: Message::POSSIBLE_TYPES.map { |x| [x.titleize, x] }, include_blank: false
7
7
  = f.input :trigger, as: :select, collection: Message::POSSIBLE_TRIGGERS.invert, include_blank: "(disabled)"
8
8
  = f.input :name
9
- = f.input :subject, hint: "All emails are from <pre class=\"d-inline\">#{html_escape(Rails.configuration.hackathon['email_from'])}</pre>".html_safe
9
+ = f.input :subject, hint: "All emails are from <pre class=\"d-inline\">#{html_escape(HackathonConfig['email_from'])}</pre>".html_safe
10
10
  = f.input :template, as: :select, collection: Message::POSSIBLE_TEMPLATES.map { |x| [x.titleize, x] }, include_blank: false
11
11
  - if @message.status == "drafted"
12
12
  = f.input :recipients, as: :select, collection: @message.possible_recipients, input_html: { class: "selectize", multiple: true, }, placeholder: "Type to search by school or type..."
@@ -31,7 +31,7 @@
31
31
  .card-header Resume
32
32
  .card-body
33
33
  - if HackathonManager.field_enabled?(:why_attend)
34
- = f.input :why_attend, label: "Why #{Rails.configuration.hackathon['name']}?", placeholder: "In a sentence or two, why would you like to attend #{Rails.configuration.hackathon['name']}?", input_html: { rows: 3, maxlength: 280 }
34
+ = f.input :why_attend, label: "Why #{HackathonConfig['name']}?", placeholder: "In a sentence or two, why would you like to attend #{HackathonConfig['name']}?", input_html: { rows: 3, maxlength: 280 }
35
35
 
36
36
  = f.input :experience, as: :select, collection: Questionnaire::POSSIBLE_EXPERIENCES.invert, include_blank: "(select one...)", label: "Experience", input_html: { "data-validate" => "presence" }
37
37
  = f.input :interest, as: :select, collection: Questionnaire::POSSIBLE_INTERESTS.invert, include_blank: "(select one...)", label: "Interest", input_html: { "data-validate" => "presence" }
@@ -64,10 +64,10 @@
64
64
  .card-body
65
65
  .supporting-text
66
66
  Please read the
67
- = link_to asset_url(Rails.configuration.hackathon['agreement_pdf_asset']), target: '_blank' do
68
- #{Rails.configuration.hackathon['name']} Agreement
67
+ = link_to asset_url(HackathonConfig['agreement_pdf_asset']), target: '_blank' do
68
+ #{HackathonConfig['name']} Agreement
69
69
  %span.fa.fa-external-link.icon-space-l-half
70
- = f.input :agreement_accepted, label: "I accept the #{Rails.configuration.hackathon['name']} agreement.", input_html: { "data-validate" => "presence" }
70
+ = f.input :agreement_accepted, label: "I accept the #{HackathonConfig['name']} agreement.", input_html: { "data-validate" => "presence" }
71
71
 
72
72
  .supporting-text
73
73
  Please read the
@@ -77,7 +77,7 @@
77
77
  .card-body
78
78
  .row
79
79
  - if HackathonManager.field_enabled?(:why_attend)
80
- %dt.col-md-4 Why #{Rails.configuration.hackathon['name']}?
80
+ %dt.col-md-4 Why #{HackathonConfig['name']}?
81
81
  %dd.col-md-8
82
82
  = @questionnaire.why_attend.presence || not_provided
83
83
  %dt.col-md-4 Experience
@@ -5,9 +5,9 @@
5
5
  = f.error_notification
6
6
 
7
7
  .wizard-stage.wizard-current
8
- - if Rails.configuration.hackathon['disclaimer']
8
+ - if HackathonConfig['disclaimer_message'].present?
9
9
  #disclaimer
10
- = markdown(Rails.configuration.hackathon['disclaimer'])
10
+ = markdown(HackathonConfig['disclaimer_message'])
11
11
 
12
12
  .form-inputs
13
13
  = f.input :first_name, input_html: { "data-validate" => "presence" }, autofocus: true, wrapper_html: { class: 'input--half' }
@@ -29,7 +29,7 @@
29
29
  .wizard-stage
30
30
  .form-inputs
31
31
  - if HackathonManager.field_enabled?(:why_attend)
32
- = f.input :why_attend, label: "Why #{Rails.configuration.hackathon['name']}?", placeholder: "In a sentence or two, why would you like to attend #{Rails.configuration.hackathon['name']}?", input_html: { rows: 3, maxlength: 280 }
32
+ = f.input :why_attend, label: "Why #{HackathonConfig['name']}?", placeholder: "In a sentence or two, why would you like to attend #{HackathonConfig['name']}?", input_html: { rows: 3, maxlength: 280 }
33
33
 
34
34
  = f.input :experience, as: :select, collection: Questionnaire::POSSIBLE_EXPERIENCES.invert, include_blank: "(select one...)", label: "Experience", input_html: { "data-validate" => "presence" }, wrapper_html: { class: 'input--half' }
35
35
  = f.input :interest, as: :select, collection: Questionnaire::POSSIBLE_INTERESTS.invert, include_blank: "(select one...)", label: "Interest", input_html: { "data-validate" => "presence" }, wrapper_html: { class: 'input--half' }
@@ -51,10 +51,10 @@
51
51
  .form-inputs
52
52
  .supporting-text
53
53
  Please read the
54
- = link_to asset_url(Rails.configuration.hackathon['agreement_pdf_asset']), target: '_blank' do
55
- #{Rails.configuration.hackathon['name']} Agreement
54
+ = link_to asset_url(HackathonConfig['agreement_pdf_asset']), target: '_blank' do
55
+ #{HackathonConfig['name']} Agreement
56
56
  %span.fa.fa-external-link.icon-space-l-half
57
- = f.input :agreement_accepted, as: :formatted_boolean, label: "I read & accept the #{Rails.configuration.hackathon['name']} agreement.", input_html: { "data-validate" => "presence" }
57
+ = f.input :agreement_accepted, as: :formatted_boolean, label: "I read & accept the #{HackathonConfig['name']} agreement.", input_html: { "data-validate" => "presence" }
58
58
 
59
59
  .supporting-text
60
60
  Please read the
@@ -2,6 +2,6 @@
2
2
  .form-container
3
3
  %h1.section-title
4
4
  Apply for
5
- %span.emphasized= Rails.configuration.hackathon['name']
5
+ %span.emphasized= HackathonConfig['name']
6
6
 
7
7
  = render 'form'
@@ -12,9 +12,9 @@
12
12
  - if @questionnaire.did_rsvp?
13
13
  - if @questionnaire.acc_status == "rsvp_confirmed"
14
14
  %p
15
- Congratulations! You're all set to attend #{Rails.configuration.hackathon['name']}!
16
- - if Rails.configuration.hackathon['thanks_for_rsvp']
17
- = markdown(Rails.configuration.hackathon['thanks_for_rsvp'])
15
+ Congratulations! You're all set to attend #{HackathonConfig['name']}!
16
+ - if HackathonConfig['thanks_for_rsvp_message'].present?
17
+ = markdown(HackathonConfig['thanks_for_rsvp_message'])
18
18
  %p.center
19
19
  = btn_link_to "Change RSVP", rsvp_path
20
20
  - else
@@ -27,9 +27,9 @@
27
27
  - elsif @questionnaire.acc_status == "denied"
28
28
  %p
29
29
  - else
30
- - if Rails.configuration.hackathon['registration_is_open']
31
- - if Rails.configuration.hackathon['thanks_for_applying']
32
- = markdown(Rails.configuration.hackathon['thanks_for_applying'])
30
+ - if HackathonConfig['registration_is_open']
31
+ - if HackathonConfig['thanks_for_applying_message'].present?
32
+ = markdown(HackathonConfig['thanks_for_applying_message'])
33
33
  - else
34
34
  %p Thanks for applying! You will be notified of your acceptance via email.
35
35
  - else
@@ -9,9 +9,9 @@
9
9
  %strong
10
10
  %span.fa.fa-check.icon-space-r-half
11
11
  YOU ARE ATTENDING!
12
- - if Rails.configuration.hackathon['thanks_for_rsvp']
12
+ - if HackathonConfig['thanks_for_rsvp_message'].present?
13
13
  %br
14
- = markdown(Rails.configuration.hackathon['thanks_for_rsvp'])
14
+ = markdown(HackathonConfig['thanks_for_rsvp_message'])
15
15
  - else
16
16
  %br
17
17
  %br
@@ -25,7 +25,7 @@
25
25
  - if @questionnaire.acc_status == "rsvp_denied"
26
26
  %p Sorry to hear you won't be with us this year.
27
27
  - else
28
- %p You've been accepted to #{Rails.configuration.hackathon['name']}!
28
+ %p You've been accepted to #{HackathonConfig['name']}!
29
29
  %p Will you be attending?
30
30
 
31
31
  .form-inputs
data/config/app.yml ADDED
@@ -0,0 +1,33 @@
1
+ # config/app.yml for rails-settings-cached
2
+ defaults: &defaults
3
+
4
+ # Logic config
5
+ registration_is_open: true
6
+ event_is_over: false
7
+ last_day_to_apply: <%= Date.new(2000, 1, 1) %>
8
+ event_start_date: <%= Date.new(2000, 1, 1) %>
9
+ auto_late_waitlist: false
10
+
11
+ # Content config
12
+ name: HackFoo
13
+ logo_asset: ""
14
+ favicon_asset: ""
15
+ agreement_pdf_asset: agreement.pdf
16
+ email_from: '"HackFoo" <hello@example.com>'
17
+ default_page_title: HackFoo - Jan 1-2, 2017
18
+
19
+ disabled_fields: ""
20
+ disclaimer_message: ""
21
+ thanks_for_applying_message: ""
22
+ thanks_for_rsvp_message: ""
23
+ bus_captain_notes: ""
24
+
25
+ development:
26
+ <<: *defaults
27
+
28
+ test:
29
+ <<: *defaults
30
+ last_day_to_apply: <%= 2.months.from_now %>
31
+
32
+ production:
33
+ <<: *defaults
@@ -13,7 +13,7 @@ Devise.setup do |config|
13
13
  # Configure the e-mail address which will be shown in Devise::Mailer,
14
14
  # note that it will be overwritten if you use your own mailer class
15
15
  # with default "from" parameter.
16
- config.mailer_sender = Rails.configuration.hackathon['email_from']
16
+ config.mailer_sender = HackathonConfig['email_from']
17
17
 
18
18
  # Configure the class responsible to send e-mails.
19
19
  # config.mailer = 'Devise::Mailer'
@@ -44,6 +44,25 @@ en:
44
44
  type: Bulk emails are sent once, manually. Automated emails are sent upon a desired trigger/event.
45
45
  name: A friendly name to recognize this email. Applicants won't see this.
46
46
  trigger: Sent automatically when a new or updated applicant matches this criteria. Does not send to anyone already matching this criteria.
47
+ hackathon_config:
48
+ registration_is_open: Specify that registration is open. This does <strong>not</strong> block registration; it only changes messaging around it.
49
+ event_is_over: Specify that the event is over
50
+ last_day_to_apply: "Last date to apply to your hackathon (format: YYYY-MM-DD)"
51
+ event_start_date: "Start date of your hackathon (format: YYYY-MM-DD)"
52
+ auto_late_waitlist: Automatically set application status to "late waitlist" for new applications
53
+
54
+ name: Your hackathon's name
55
+ logo_asset: Optional logo asset made available in your Rails app's app/assets/images/ folder
56
+ favicon_asset: Optional favicon asset made available in your Rails app's app/assets/images/ folder
57
+ agreement_pdf_asset: Your hackathon's agreement (e.g. school activity release form), made available in your Rails app's app/assets/images/ folder
58
+ email_from: '"From" email address for all emails sent through the website (e.g. BrickHack &lt;hello@example.com&gt;)'
59
+ default_page_title: Default &lt;title&gt; for all pages (e.g. HackFoo - Jan 1-2, 2017)
60
+
61
+ disabled_fields: Optional comma-separated list of fields (e.g. why_attend)
62
+ disclaimer_message: Optional message that appears before signing up & applying. Supports markdown.
63
+ thanks_for_applying_message: Optional message that appears after completing an application. Supports markdown.
64
+ thanks_for_rsvp_message: Optional message that appears after RSVP'ing as attending. Supports markdown.
65
+ bus_captain_notes: Optional message that appers on the bus captain's bus list page. Supports markdown.
47
66
  placeholders:
48
67
  bus_list:
49
68
  notes: |
@@ -75,3 +94,8 @@ en:
75
94
  vcs_url: https://github.com/coderit
76
95
  user:
77
96
  email: joe@example.com
97
+ labels:
98
+ hackathon_config:
99
+ name: Hackathon Name
100
+ email_from: From Email
101
+ agreement_pdf_asset: Agreement PDF Asset
data/config/routes.rb CHANGED
@@ -78,8 +78,7 @@ Rails.application.routes.draw do
78
78
  post :mlh_info_applied, on: :collection
79
79
  post :mlh_info_checked_in, on: :collection
80
80
  end
81
- resource :config do
82
- end
81
+ resources :configs
83
82
  resources :trackable_events
84
83
  resources :trackable_tags
85
84
  end
@@ -0,0 +1,17 @@
1
+ class CreateSettings < ActiveRecord::Migration[5.2]
2
+ def self.up
3
+ create_table :settings do |t|
4
+ t.string :var, null: false
5
+ t.text :value, null: true
6
+ t.integer :thing_id, null: true
7
+ t.string :thing_type, null: true, limit: 30
8
+ t.timestamps
9
+ end
10
+
11
+ add_index :settings, %i(thing_type thing_id var), unique: true
12
+ end
13
+
14
+ def self.down
15
+ drop_table :settings
16
+ end
17
+ end
@@ -1,6 +1,6 @@
1
1
  ## Congratulations <%= @questionnaire.first_name %>, you're in!
2
2
 
3
- You have been accepted to attend <%= Rails.configuration.hackathon['name'] %>! **Please RSVP:**
3
+ You have been accepted to attend <%= HackathonConfig['name'] %>! **Please RSVP:**
4
4
 
5
5
  <p>
6
6
  <a href="https://brickhack.io/rsvp/accept" class="button" target="_blank">Yes, I will Attend &raquo;</a>
@@ -4,7 +4,7 @@
4
4
 
5
5
  Hey <%= @questionnaire.first_name %>,
6
6
 
7
- We've received your application to <%= Rails.configuration.hackathon['name'] %>!
7
+ We've received your application to <%= HackathonConfig['name'] %>!
8
8
 
9
9
  If needed, you can edit your information by clicking the button below.
10
10
 
@@ -1,6 +1,6 @@
1
1
  ## You are confirmed!
2
2
 
3
- This is your confirmation for <%= Rails.configuration.hackathon['name'] %>! We can't wait to see you there. In the meantime, follow us on [Facebook](https://www.facebook.com/brickhackrit) and [Twitter](https://twitter.com/brickhackrit) to get news and updates.
3
+ This is your confirmation for <%= HackathonConfig['name'] %>! We can't wait to see you there. In the meantime, follow us on [Facebook](https://www.facebook.com/brickhackrit) and [Twitter](https://twitter.com/brickhackrit) to get news and updates.
4
4
 
5
5
  **If you can no longer attend, please let us know so we can open the spot to someone else. [I Can No Longer Attend &raquo;](https://brickhack.io/rsvp/deny)**
6
6
 
@@ -1,20 +1,8 @@
1
1
  require "hackathon_manager/engine"
2
2
 
3
3
  module HackathonManager
4
- def self.reload_config(app)
5
- hackathon = app.config_for(:hackathon)
6
-
7
- # Applications without a specified config.time_zone will parse
8
- # this as a string instead of a Time
9
- if hackathon['last_day_to_apply'].is_a?(String)
10
- hackathon['last_day_to_apply'] = Time.parse(hackathon['last_day_to_apply'])
11
- end
12
-
13
- app.config.hackathon = hackathon
14
- end
15
-
16
4
  def self.field_enabled?(field)
17
- disabled_fields = Rails.configuration.hackathon['disabled_fields'] || []
5
+ disabled_fields = HackathonConfig.disabled_fields || ''
18
6
  !disabled_fields.include?(field.to_s)
19
7
  end
20
8
  end