From 0aa8d88ffb3e26ee1a5b7f7f49e08f6e9cb2ace5 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Tue, 5 Oct 2021 15:36:31 +0100 Subject: [PATCH] Render html from JSON questions (#33) * Render html from questions with example * Render html for all question types --- app/views/form/_checkbox_question.html.erb | 2 +- app/views/form/_date_question.html.erb | 2 +- app/views/form/_numeric_question.html.erb | 2 +- app/views/form/_radio_question.html.erb | 2 +- app/views/form/_text_question.html.erb | 2 +- config/forms/2021_2022.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/form/_checkbox_question.html.erb b/app/views/form/_checkbox_question.html.erb index 0a958fb0e..75ec2d453 100644 --- a/app/views/form/_checkbox_question.html.erb +++ b/app/views/form/_checkbox_question.html.erb @@ -1,5 +1,5 @@ <%= f.govuk_check_boxes_fieldset question_key, - legend: { text: question["header"], size: "l" }, + legend: { text: question["header"].html_safe, size: "l" }, hint: { text: question["hint_text"] } do %> <% question["answer_options"].map do |key, val| %> diff --git a/app/views/form/_date_question.html.erb b/app/views/form/_date_question.html.erb index 413f0255e..f4a4ddf93 100644 --- a/app/views/form/_date_question.html.erb +++ b/app/views/form/_date_question.html.erb @@ -1,5 +1,5 @@ <%= f.govuk_date_field question_key, hint: { text: question["hint_text"] }, - legend: { text: question["header"], size: "l"}, + legend: { text: question["header"].html_safe, size: "l"}, width: 20 %> diff --git a/app/views/form/_numeric_question.html.erb b/app/views/form/_numeric_question.html.erb index 3df0fbe86..1b98ed158 100644 --- a/app/views/form/_numeric_question.html.erb +++ b/app/views/form/_numeric_question.html.erb @@ -1,5 +1,5 @@ <%= f.govuk_number_field question_key, hint: { text: question["hint_text"] }, - label: { text: question["header"], size: "l"}, + label: { text: question["header"].html_safe, size: "l"}, min: question["min"], max: question["max"], step: question["step"], width: 20 %> diff --git a/app/views/form/_radio_question.html.erb b/app/views/form/_radio_question.html.erb index ed5d1317e..a74153456 100644 --- a/app/views/form/_radio_question.html.erb +++ b/app/views/form/_radio_question.html.erb @@ -1,5 +1,5 @@ <%= f.govuk_radio_buttons_fieldset question_key, - legend: { text: question["header"], size: "l" }, + legend: { text: question["header"].html_safe, size: "l" }, hint: { text: question["hint_text"] }, small: (question["answer_options"].size > 5) do %> diff --git a/app/views/form/_text_question.html.erb b/app/views/form/_text_question.html.erb index c040be8d9..6bf73338e 100644 --- a/app/views/form/_text_question.html.erb +++ b/app/views/form/_text_question.html.erb @@ -1,5 +1,5 @@ <%= f.govuk_text_field question_key, hint: { text: question["hint_text"] }, - label: { text: question["header"], size: "l"}, + label: { text: question["header"].html_safe, size: "l"}, width: 20 %> diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index ee64f40b0..cc552eb9f 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -337,7 +337,7 @@ "description": "", "questions":{ "medical_conditions": { - "header": "Does anyone in the household have a physical condition, mental health condition, or other illness that they expect to last for 12 months or more?", + "header": "Does anyone in the household have any of the following that they expect to last for 12 months or more:", "hint_text": "", "type": "radio", "answer_options": {