hackathon_manager 0.5.2 → 0.5.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b27c3c17349d92f0eacdfbef93d1817c3b0d83c
4
- data.tar.gz: 824c31088ef9273fa8ef2491ace762005777b0a0
3
+ metadata.gz: 7c04e6bb556860898750dcc103ff9fb126e0d94f
4
+ data.tar.gz: 37dc7a23db1da9522c07cc0059e355bf86dd7a79
5
5
  SHA512:
6
- metadata.gz: b7a39efbe02bda77884de5b41c94b42b1c90a5d139981aa06b39d57b867263e626abca6408f0b2a8f72c59818323e3077867474d403cf4e61aa168010999ca3c
7
- data.tar.gz: 846d2c8dd5c6f39d4b57e74d51ce1cba8c8dcf1db718cfe283fac15a6c5dcfa018084339a9c9e78c57335c235903ed481c49eaf1a3543a95ea9dc10c543ff21f
6
+ metadata.gz: df65de1e9ecd9f59298436174adcdcc4d1f3cdac8b9f6ba4e62872cc1832045669c42b62d61b5e6f9772fe989a7d314e5b94fd942799c449dd6a66482f77c180
7
+ data.tar.gz: 656943183e21e30a5c398818657de969c9be3f263fa2b3826845d9c8c83e712de3423015ff81e96b5c59f3ca72d187bd14c887da2ae90d609d47a72420027a02
@@ -170,8 +170,6 @@ input[type=checkbox]
170
170
  opacity: 0
171
171
  &:hover
172
172
  background: #eee
173
- &::after
174
- opacity: 0.3
175
173
  &:checked
176
174
  &::after
177
175
  opacity: 1
@@ -154,7 +154,7 @@ class Manage::QuestionnairesController < Manage::ApplicationController
154
154
  :portfolio_url, :vcs_url, :agreement_accepted, :bus_captain_interest,
155
155
  :riding_bus, :phone, :can_share_info, :code_of_conduct_accepted,
156
156
  :travel_not_from_school, :travel_location, :data_sharing_accepted,
157
- :resume, :delete_resume, :is_bus_captain
157
+ :resume, :delete_resume, :is_bus_captain, :why_attend
158
158
  )
159
159
  end
160
160
 
@@ -128,7 +128,7 @@ class QuestionnairesController < ApplicationController
128
128
  :portfolio_url, :vcs_url, :agreement_accepted, :bus_captain_interest,
129
129
  :riding_bus, :phone, :can_share_info, :code_of_conduct_accepted,
130
130
  :travel_not_from_school, :travel_location, :data_sharing_accepted,
131
- :resume, :delete_resume
131
+ :resume, :delete_resume, :why_attend
132
132
  )
133
133
  end
134
134
 
@@ -11,6 +11,10 @@ class Questionnaire < ApplicationRecord
11
11
  validates_presence_of :code_of_conduct_accepted, message: "Must accept"
12
12
  validates_presence_of :data_sharing_accepted, message: "Must accept"
13
13
 
14
+ if HackathonManager.field_enabled?(:why_attend)
15
+ validates_presence_of :why_attend
16
+ end
17
+
14
18
  has_attached_file :resume
15
19
  validates_attachment_content_type :resume, content_type: %w[application/pdf], message: "Invalid file type"
16
20
  validates_attachment_size :resume, in: 0..2.megabytes, message: "File size is too big"
@@ -1,3 +1,7 @@
1
+ - if HackathonManager.field_enabled?(:why_attend)
2
+ %p
3
+ %b Why #{Rails.configuration.hackathon['name']}?
4
+ %p= @questionnaire.why_attend
1
5
  %p
2
6
  %b Experience:
3
7
  = Questionnaire::POSSIBLE_EXPERIENCES[@questionnaire.experience]
@@ -29,6 +29,9 @@
29
29
 
30
30
  .form-inputs
31
31
  %br
32
+ - if HackathonManager.field_enabled?(:why_attend)
33
+ = 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
+
32
35
  = f.input :experience, as: :select, collection: Questionnaire::POSSIBLE_EXPERIENCES.invert, include_blank: "(select one...)", label: "Experience", input_html: { "data-validate" => "presence" }
33
36
  = f.input :interest, as: :select, collection: Questionnaire::POSSIBLE_INTERESTS.invert, include_blank: "(select one...)", label: "Interest", input_html: { "data-validate" => "presence" }
34
37
 
@@ -32,6 +32,9 @@
32
32
 
33
33
  .wizard-stage
34
34
  .form-inputs
35
+ - if HackathonManager.field_enabled?(:why_attend)
36
+ = 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 }
37
+
35
38
  = 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' }
36
39
  = 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' }
37
40
 
@@ -0,0 +1,5 @@
1
+ class AddWhyAttendToQuestionnaires < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :questionnaires, :why_attend, :text
4
+ end
5
+ end
@@ -12,4 +12,9 @@ module HackathonManager
12
12
 
13
13
  app.config.hackathon = hackathon
14
14
  end
15
+
16
+ def self.field_enabled?(field)
17
+ disabled_fields = Rails.configuration.hackathon['disabled_fields'] || []
18
+ !disabled_fields.include?(field.to_s)
19
+ end
15
20
  end
@@ -1,3 +1,3 @@
1
1
  module HackathonManager
2
- VERSION = '0.5.2'.freeze
2
+ VERSION = '0.5.3'.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.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Olivera
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-18 00:00:00.000000000 Z
11
+ date: 2017-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -633,6 +633,7 @@ files:
633
633
  - db/migrate/20161212030010_add_interest_to_questionnaire.rb
634
634
  - db/migrate/20170107210122_create_school_name_duplicates.rb
635
635
  - db/migrate/20170128063020_install_blazer.rb
636
+ - db/migrate/20171220042158_add_why_attend_to_questionnaires.rb
636
637
  - db/schools.csv
637
638
  - db/seeds.rb
638
639
  - lib/hackathon_manager.rb