From 654d4ae8e5f37a205b08b70512cb1da1f345181b Mon Sep 17 00:00:00 2001 From: magicmilo Date: Fri, 29 Oct 2021 13:32:51 +0100 Subject: [PATCH] add select --- app/views/form/_select_question.html.erb | 5 ++ config/forms/2021_2022.json | 78 ++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 app/views/form/_select_question.html.erb diff --git a/app/views/form/_select_question.html.erb b/app/views/form/_select_question.html.erb new file mode 100644 index 000000000..c4d8dccdc --- /dev/null +++ b/app/views/form/_select_question.html.erb @@ -0,0 +1,5 @@ +<%= f.govuk_collection_select question_key, question["answer_options"], +:id, +:name, +label: { text: question["header"].html_safe, size: "l" }, +hint: { text: question["hint_text"] } %> \ No newline at end of file diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index f4cf447c3..257f5fdd7 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -3,6 +3,84 @@ "start_year": 2021, "end_year": 2022, "sections": { + "about_this_log": { + "label": "About this log", + "subsections": { + "about_this_log": { + "label": "About this log", + "pages": { + "gdpr_acceptance": { + "header": "About this log", + "description": "About this log", + "questions": { + "gdpr_acceptance": { + "check_answer_label": "", + "header": "Has the tenant or buyer seen the DLUHC privacy notice?", + "hint_text": "", + "type": "select", + "answer_options": { + "0": "Yes", + "1": "No" + } + } + }, + "conditional_route_to": { + "organisation_details": { "gdpr_acceptance": "Yes" } + }, + "default_next_page": "gdpr_declined" + }, + "gdpr_declined": { + "header": "You cannot use this service", + "description": "We cannot accept data about a tenant or buyer unless they’ve seen the DLUHC privacy notice.", + "questions": { + } + }, + "organisation_details": { + "header": "About this log", + "description": "Organisation Details", + "questions": { + "property_owner_organisation": { + "check_answer_label": "", + "header": "Which organisation owns this property?", + "hint_text": "", + "type": "radio", + "answer_options": { + "0": "A", + "1": "B" + } + }, + "property_manager_organisation": { + "check_answer_label": "", + "header": "Which organisation manages this property?", + "hint_text": "", + "type": "radio", + "answer_options": { + "0": "A", + "1": "B" + } + } + } + }, + "sale_or_letting": { + "header": "About this log", + "description": "Is this a sale or a letting?", + "questions": { + "sale_or_letting": { + "check_answer_label": "", + "header": "Is this a sale or a letting?", + "hint_text": "", + "type": "radio", + "answer_options": { + "0": "Sale", + "1": "Letting" + } + } + } + } + } + } + } + }, "household": { "label": "About the household", "subsections": {