Skip to content

Commit f740ed9

Browse files
refactor: Hides several dangling dietary restrictions in digital mode (#533)
* refactor: Hides several dangling dietary restrictions in digital mode * fix: Hides dietary restrictions form questionnaire overview Co-authored-by: JeremyRudman <[email protected]>
1 parent 43cd785 commit f740ed9

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

app/views/application/_questionnaire_summary.html.haml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121
%p
2222
%b Shirt size:
2323
= @questionnaire.shirt_size
24-
%p
25-
%b Dietary restrictions
26-
= @questionnaire.dietary_restrictions || "<i>(none)</i>".html_safe
24+
- if !HackathonConfig['digital_hackathon']
25+
%p
26+
%b Dietary restrictions
27+
= @questionnaire.dietary_restrictions || "<i>(none)</i>".html_safe
2728
%p
2829
%b Special needs
2930
= @questionnaire.special_needs || "<i>(none)</i>".html_safe

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@
3333
.row
3434
%dt.col-md-4 Shirt size
3535
%dd.col-md-8= @questionnaire.shirt_size
36-
%dt.col-md-4 Dietary restrictions
37-
%dd.col-md-8
38-
- if @questionnaire.dietary_restrictions.present?
39-
%span.fa.fa-exclamation-triangle.text-warning.icon-space-r-half
40-
= @questionnaire.dietary_restrictions
41-
- else
42-
%span.text-muted (none)
36+
- if !HackathonConfig['digital_hackathon']
37+
%dt.col-md-4 Dietary restrictions
38+
%dd.col-md-8
39+
- if @questionnaire.dietary_restrictions.present?
40+
%span.fa.fa-exclamation-triangle.text-warning.icon-space-r-half
41+
= @questionnaire.dietary_restrictions
42+
- else
43+
%span.text-muted (none)
4344
%dt.col-md-4 Special needs
4445
%dd.col-md-8
4546
- if @questionnaire.special_needs.present?

app/views/questionnaires/_form.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
= f.input :shirt_size, as: :select, collection: Questionnaire::POSSIBLE_SHIRT_SIZES, include_blank: "(select one...)", input_html: { "data-validate" => "presence" }
4545

4646
- 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
47+
= f.input :dietary_restrictions, as: :text, label: "Dietary restrictions", wrapper_html: { class: 'input--half' }, maxlength: Questionnaire::DIETARY_SPECIAL_NEEDS_MAX_LENGTH
4848
= f.input :special_needs, as: :text, label: "Special needs", wrapper_html: { class: 'input--half' }, maxlength: Questionnaire::DIETARY_SPECIAL_NEEDS_MAX_LENGTH
4949

5050
- if @agreements.any?

0 commit comments

Comments
 (0)