hackathon_manager 0.13.11 → 0.13.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f53405ab4318feef8a9761d61a8caab8a3b15ee84040b1065b62633432adca1e
4
- data.tar.gz: 9a67eded41cd30dc3d428098207aed0273581ef223858090453ddfcb1a72065f
3
+ metadata.gz: 1d52647ef1474db0321f4387324553a0010786f68ef9fbf91ba5e44ddc59613f
4
+ data.tar.gz: ece7b76b4af25ec10ce1b0242090193b37e9b6a47674cc15cbff5ac8353ff196
5
5
  SHA512:
6
- metadata.gz: c161eee3d5f9d47e0d2f471e64ca9dd510ea1d37d2475e83cd5c8e418cda3b4bfde76162abbf195026bde120ab54b2d032427a59d3b77a710af34f33de11a1f1
7
- data.tar.gz: 714a2191b9ccf482088f653b851c1605e80c4d9b7633ab638cd41186284ad2688ba76fe1b68d9b8f446c03a2a6f845535b7df2ad1f374ea1f1363930d00de350
6
+ metadata.gz: b6dc569d4444ad9a63d9f7bba5902258c834dce2972dd8fb978fa9402ed917750554b236e3d22303cf142dd0e26c6b140c589a8cd92dac766958bf210c842b11
7
+ data.tar.gz: d9ab52a36ef5e46a6e50a46f57c660a4a8f234fe8d49452c0793351af3a74ad5f5d127fc5fc8f02cc16d28613eed2d32b709a9db93b22dfe55ac2e8047c5b8c6
data/README.md CHANGED
@@ -25,6 +25,7 @@ HackathonManager uses a variety of third-party services & Ruby gems:
25
25
  * [Sparkpost](https://www.sparkpost.com/) (email)
26
26
  * [Paperclip](https://github.com/thoughtbot/paperclip) + [Amazon S3](https://aws.amazon.com/s3/) (resume storage)
27
27
  * [Chartkick](http://chartkick.com/) (management charts)
28
+ * [Blazer](https://github.com/ankane/blazer) (custom SQL queries & analytics)
28
29
 
29
30
  Steps to get the basic flow working:
30
31
 
@@ -29,6 +29,7 @@ class Manage::QuestionnairesController < Manage::ApplicationController
29
29
  create_params = questionnaire_params
30
30
  email = create_params.delete(:email)
31
31
  create_params = convert_school_name_to_id(create_params)
32
+ create_params = convert_boarded_bus_param(create_params)
32
33
  @questionnaire = ::Questionnaire.new(create_params)
33
34
  if @questionnaire.valid?
34
35
  users = User.where(email: email)
@@ -52,6 +53,7 @@ class Manage::QuestionnairesController < Manage::ApplicationController
52
53
  email = update_params.delete(:email)
53
54
  @questionnaire.user.update_attributes(email: email) if email.present?
54
55
  update_params = convert_school_name_to_id(update_params)
56
+ update_params = convert_boarded_bus_param(update_params, @questionnaire)
55
57
  @questionnaire.update_attributes(update_params)
56
58
  respond_with(:manage, @questionnaire)
57
59
  end
@@ -153,10 +155,17 @@ class Manage::QuestionnairesController < Manage::ApplicationController
153
155
  :phone, :can_share_info, :code_of_conduct_accepted,
154
156
  :travel_not_from_school, :travel_location, :data_sharing_accepted,
155
157
  :graduation_year, :race_ethnicity, :resume, :delete_resume, :why_attend,
156
- :bus_list_id, :is_bus_captain
158
+ :bus_list_id, :is_bus_captain, :boarded_bus
157
159
  )
158
160
  end
159
161
 
162
+ def convert_boarded_bus_param(values, questionnaire = nil)
163
+ boarded_bus = values.delete(:boarded_bus)
164
+ current_value = questionnaire&.boarded_bus_at
165
+ values[:boarded_bus_at] = boarded_bus == '1' ? (current_value || Time.now) : nil
166
+ values
167
+ end
168
+
160
169
  def set_questionnaire
161
170
  @questionnaire = ::Questionnaire.find(params[:id])
162
171
  end
@@ -4,75 +4,84 @@
4
4
  - if f.error_notification.present?
5
5
  = f.error_notification
6
6
 
7
- %fieldset
8
- - if @questionnaire&.user&.provider == 'mlh'
9
- %legend Provided by My MLH
10
- %br
11
- = f.input :first_name, input_html: { "data-validate" => "presence" }, label: "First Name", autofocus: true
12
- = f.input :last_name, input_html: { "data-validate" => "presence" }, label: "Last Name"
13
- = f.input :email, input_html: { "data-validate" => "presence email", value: @questionnaire.user.try(:email) }, required: true, hint: 'Can be an existing user (without a questionnaire) or a new user. If this is a new user, they will receive a randomly-generated password that they must request a password reset for.'
14
- = f.input :phone, input_html: { "data-validate" => "presence" }
15
- = f.input :date_of_birth, start_year: Date.today.year - 18, end_year: Date.today.year - 90, order: [:month, :day, :year], input_html: { "data-validate" => "presence" }
16
-
17
- = f.input :school_id, as: :school_selection, input_html: { "data-validate" => "presence" }
18
- = f.input :level_of_study, input_html: { "data-validate" => "presence" }
19
- = f.input :major, input_html: { "data-validate" => "presence" }
20
- = f.input :shirt_size, as: :select, collection: Questionnaire::POSSIBLE_SHIRT_SIZES, include_blank: "(select one...)", input_html: { "data-validate" => "presence" }
21
- = f.input :gender, input_html: { "data-validate" => "presence" }
22
- = f.input :dietary_restrictions, label: "Health Restrictions"
23
- = f.input :special_needs, label: "Special needs"
24
-
25
- %br
26
-
27
- .form-inputs
28
- %br
29
- - if HackathonManager.field_enabled?(:why_attend)
30
- = 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 }
31
-
32
- = f.input :experience, as: :select, collection: Questionnaire::POSSIBLE_EXPERIENCES.invert, include_blank: "(select one...)", label: "Experience", input_html: { "data-validate" => "presence" }
33
- = f.input :interest, as: :select, collection: Questionnaire::POSSIBLE_INTERESTS.invert, include_blank: "(select one...)", label: "Interest", input_html: { "data-validate" => "presence" }
34
-
35
- = f.input :graduation_year, as: :select, collection: Questionnaire::POSSIBLE_GRAD_YEARS, include_blank: "(select one...)", label: "Graduation year", input_html: { "data-validate" => "presence" }, wrapper_html: { class: 'input--half' }
36
- = f.input :race_ethnicity, as: :select, collection: Questionnaire::POSSIBLE_RACE_ETHNICITIES, include_blank: "(select one...)", label: "Race/Ethnicity", input_html: { "data-validate" => "presence" }, wrapper_html: { class: 'input--half' }
37
-
38
- = f.input :resume, as: :deletable_attachment, hint: "Must be 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 (PDF)"
39
-
40
- = f.input :portfolio_url, label: "Portfolio Link"
41
- = f.input :vcs_url, label: "GitHub/BitBucket"
42
-
43
- = f.input :can_share_info, label: "Share resume with employers?"
44
-
45
- %hr
46
-
47
- - travel_state = !@questionnaire.new_record? && @questionnaire.travel_not_from_school
48
- = f.input :travel_not_from_school, label: "I will not be traveling from my school"
49
- = f.input :travel_location, input_html: { "data-validate" => "presence", disabled: !travel_state }, wrapper_html: { style: travel_state ? "" : "display: none" }, label: "Travel Location"
50
-
51
- = f.association :bus_list, label: "Bus list", include_blank: 'Not travelling on a sponsored bus'
52
- = f.input :is_bus_captain, label: "Is Bus Captain"
53
-
54
- %hr
55
-
56
- .form-inputs
57
- .supporting-text
58
- Please read the
59
- = link_to asset_url(Rails.configuration.hackathon['agreement_pdf_asset']), target: '_blank' do
60
- #{Rails.configuration.hackathon['name']} Agreement
61
- %span.fa.fa-external-link.icon-space-l-half
62
- = f.input :agreement_accepted, label: "I accept the #{Rails.configuration.hackathon['name']} agreement.", input_html: { "data-validate" => "presence" }
63
-
64
- .supporting-text
65
- Please read the
66
- %a{ href:"http://static.mlh.io/docs/mlh-code-of-conduct.pdf", target: "_blank" }
67
- MLH Code of Conduct
68
- %span.fa.fa-external-link.icon-space-l-half
69
- = f.input :code_of_conduct_accepted, label: "I accept the MLH Code of Conduct.", input_html: { "data-validate" => "presence" }
70
-
71
- .supporting-text
72
- I agree to the terms of both the
73
- <a href="https://github.com/MLH/mlh-policies/tree/master/prize-terms-and-conditions" target="_blank">MLH Contest Terms</a> and Conditions and the
74
- <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.
75
- = f.input :data_sharing_accepted, label: "I accept the MLH policies.", input_html: { "data-validate" => "presence" }
76
-
77
- .center
7
+ .row
8
+ .col-xl-6
9
+ .card.mb-4
10
+ .card-header Personal information
11
+ .card-body
12
+ - if @questionnaire&.user&.provider == 'mlh'
13
+ %h6.card-subtitle.mb-2
14
+ %span.badge.badge-info Provided by My MLH
15
+ = f.input :first_name, input_html: { "data-validate" => "presence" }, label: "First Name", autofocus: true
16
+ = f.input :last_name, input_html: { "data-validate" => "presence" }, label: "Last Name"
17
+ = f.input :email, input_html: { "data-validate" => "presence email", value: @questionnaire.user.try(:email) }, required: true, hint: 'Can be an existing user (without a questionnaire) or a new user. If this is a new user, they will receive a randomly-generated password that they must request a password reset for.'
18
+ = f.input :phone, input_html: { "data-validate" => "presence" }
19
+ = f.input :date_of_birth, start_year: Date.today.year - 18, end_year: Date.today.year - 90, order: [:month, :day, :year], input_html: { "data-validate" => "presence" }
20
+
21
+ = f.input :school_id, as: :school_selection, input_html: { "data-validate" => "presence" }
22
+ = f.input :level_of_study, input_html: { "data-validate" => "presence" }
23
+ = f.input :major, input_html: { "data-validate" => "presence" }
24
+ = f.input :shirt_size, as: :select, collection: Questionnaire::POSSIBLE_SHIRT_SIZES, include_blank: "(select one...)", input_html: { "data-validate" => "presence" }
25
+ = f.input :gender, input_html: { "data-validate" => "presence" }
26
+ = f.input :dietary_restrictions, label: "Health Restrictions"
27
+ = f.input :special_needs, label: "Special needs"
28
+
29
+ .col-xl-6
30
+ .card.mb-4
31
+ .card-header Resume
32
+ .card-body
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 }
35
+
36
+ = f.input :experience, as: :select, collection: Questionnaire::POSSIBLE_EXPERIENCES.invert, include_blank: "(select one...)", label: "Experience", input_html: { "data-validate" => "presence" }
37
+ = f.input :interest, as: :select, collection: Questionnaire::POSSIBLE_INTERESTS.invert, include_blank: "(select one...)", label: "Interest", input_html: { "data-validate" => "presence" }
38
+
39
+ = f.input :graduation_year, as: :select, collection: Questionnaire::POSSIBLE_GRAD_YEARS, include_blank: "(select one...)", label: "Graduation year", input_html: { "data-validate" => "presence" }, wrapper_html: { class: 'input--half' }
40
+ = f.input :race_ethnicity, as: :select, collection: Questionnaire::POSSIBLE_RACE_ETHNICITIES, include_blank: "(select one...)", label: "Race/Ethnicity", input_html: { "data-validate" => "presence" }, wrapper_html: { class: 'input--half' }
41
+
42
+ = f.input :resume, as: :deletable_attachment, hint: "Must be 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 (PDF)"
43
+
44
+ = f.input :portfolio_url, label: "Portfolio Link"
45
+ = f.input :vcs_url, label: "GitHub/BitBucket"
46
+
47
+ = f.input :can_share_info, label: "Share resume with employers?"
48
+
49
+ .col-xl-6
50
+ .card.mb-4
51
+ .card-header Travel information
52
+ .card-body
53
+ - travel_state = !@questionnaire.new_record? && @questionnaire.travel_not_from_school
54
+ = f.input :travel_not_from_school, label: "I will not be traveling from my school"
55
+ = f.input :travel_location, input_html: { "data-validate" => "presence", disabled: !travel_state }, wrapper_html: { style: travel_state ? "" : "display: none" }, label: "Travel Location"
56
+
57
+ = f.association :bus_list, label: "Bus list", include_blank: 'Not travelling on a sponsored bus'
58
+ = f.input :boarded_bus, as: :boolean, label: "Boarded bus", input_html: { checked: @questionnaire.boarded_bus_at.present? }
59
+ = f.input :is_bus_captain, label: "Is Bus Captain"
60
+
61
+ .col-xl-6
62
+ .card.mb-4
63
+ .card-header Agreements
64
+ .card-body
65
+ .supporting-text
66
+ Please read the
67
+ = link_to asset_url(Rails.configuration.hackathon['agreement_pdf_asset']), target: '_blank' do
68
+ #{Rails.configuration.hackathon['name']} Agreement
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" }
71
+
72
+ .supporting-text
73
+ Please read the
74
+ %a{ href:"http://static.mlh.io/docs/mlh-code-of-conduct.pdf", target: "_blank" }
75
+ MLH Code of Conduct
76
+ %span.fa.fa-external-link.icon-space-l-half
77
+ = f.input :code_of_conduct_accepted, label: "I accept the MLH Code of Conduct.", input_html: { "data-validate" => "presence" }
78
+
79
+ .supporting-text
80
+ I agree to the terms of both the
81
+ <a href="https://github.com/MLH/mlh-policies/tree/master/prize-terms-and-conditions" target="_blank">MLH Contest Terms</a> and Conditions and the
82
+ <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.
83
+ = f.input :data_sharing_accepted, label: "I accept the MLH policies.", input_html: { "data-validate" => "presence" }
84
+
85
+ .center.mb-4
78
86
  = f.button :submit, value: ( @questionnaire.new_record? ? 'Create' : 'Save' ), class: 'btn-primary'
87
+ %hr
@@ -5,7 +5,7 @@
5
5
  = render 'top_alerts'
6
6
 
7
7
  .card.mb-3
8
- .card-header Personal Information
8
+ .card-header Personal information
9
9
  .card-body
10
10
  .row
11
11
  %dt.col-md-4 First name
@@ -79,9 +79,8 @@
79
79
  .col
80
80
  %h4.pb-0
81
81
  Questionnaires
82
- %small.text-muted (#{@school.questionnaires.count} total)
82
+ %small.text-muted (#{@school.questionnaires.count} total, #{@school.questionnaires.count { |q| q.checked_in? }} checked in)
83
83
  %table.table
84
- %caption #{@school.questionnaires.count} total
85
84
  %thead
86
85
  %tr
87
86
  %th
@@ -1,3 +1,3 @@
1
1
  module HackathonManager
2
- VERSION = '0.13.11'.freeze
2
+ VERSION = '0.13.12'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hackathon_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.11
4
+ version: 0.13.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Olivera
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-16 00:00:00.000000000 Z
11
+ date: 2019-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails