From e3f07b9a9e3a27873c973c1bf4af7bb0076ae319 Mon Sep 17 00:00:00 2001 From: "Chris Baudouin, Jr" Date: Sun, 17 Jan 2021 19:19:26 -0500 Subject: [PATCH 1/2] refactor: Hides several dangling dietary restrictions in digital mode --- app/views/application/_questionnaire_summary.html.haml | 7 ++++--- app/views/questionnaires/_form.html.haml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/application/_questionnaire_summary.html.haml b/app/views/application/_questionnaire_summary.html.haml index 8f3ae4b7b..159334925 100644 --- a/app/views/application/_questionnaire_summary.html.haml +++ b/app/views/application/_questionnaire_summary.html.haml @@ -21,9 +21,10 @@ %p %b Shirt size: = @questionnaire.shirt_size -%p - %b Dietary restrictions - = @questionnaire.dietary_restrictions || "(none)".html_safe +- if !HackathonConfig['digital_hackathon'] + %p + %b Dietary restrictions + = @questionnaire.dietary_restrictions || "(none)".html_safe %p %b Special needs = @questionnaire.special_needs || "(none)".html_safe diff --git a/app/views/questionnaires/_form.html.haml b/app/views/questionnaires/_form.html.haml index ba8a35948..adc179120 100644 --- a/app/views/questionnaires/_form.html.haml +++ b/app/views/questionnaires/_form.html.haml @@ -44,7 +44,7 @@ = f.input :shirt_size, as: :select, collection: Questionnaire::POSSIBLE_SHIRT_SIZES, include_blank: "(select one...)", input_html: { "data-validate" => "presence" } - if !HackathonConfig['digital_hackathon'] - = f.input :dietary_restrictions, as: :text, label: "Health restrictions", wrapper_html: { class: 'input--half' }, maxlength: Questionnaire::DIETARY_SPECIAL_NEEDS_MAX_LENGTH + = f.input :dietary_restrictions, as: :text, label: "Dietary restrictions", wrapper_html: { class: 'input--half' }, maxlength: Questionnaire::DIETARY_SPECIAL_NEEDS_MAX_LENGTH = f.input :special_needs, as: :text, label: "Special needs", wrapper_html: { class: 'input--half' }, maxlength: Questionnaire::DIETARY_SPECIAL_NEEDS_MAX_LENGTH - if @agreements.any? From b65a33b079617a0db7c1b2a956ef808d1566fbe3 Mon Sep 17 00:00:00 2001 From: "Chris Baudouin, Jr" Date: Mon, 25 Jan 2021 21:50:20 -0500 Subject: [PATCH 2/2] fix: Hides dietary restrictions form questionnaire overview --- .../manage/questionnaires/_overview.html.haml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/views/manage/questionnaires/_overview.html.haml b/app/views/manage/questionnaires/_overview.html.haml index 9c54f3d43..e409b4601 100644 --- a/app/views/manage/questionnaires/_overview.html.haml +++ b/app/views/manage/questionnaires/_overview.html.haml @@ -33,13 +33,14 @@ .row %dt.col-md-4 Shirt size %dd.col-md-8= @questionnaire.shirt_size - %dt.col-md-4 Dietary restrictions - %dd.col-md-8 - - if @questionnaire.dietary_restrictions.present? - %span.fa.fa-exclamation-triangle.text-warning.icon-space-r-half - = @questionnaire.dietary_restrictions - - else - %span.text-muted (none) + - if !HackathonConfig['digital_hackathon'] + %dt.col-md-4 Dietary restrictions + %dd.col-md-8 + - if @questionnaire.dietary_restrictions.present? + %span.fa.fa-exclamation-triangle.text-warning.icon-space-r-half + = @questionnaire.dietary_restrictions + - else + %span.text-muted (none) %dt.col-md-4 Special needs %dd.col-md-8 - if @questionnaire.special_needs.present?