From 6053bcefd422a80e9363f53bbe7f1808348a8439 Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Sat, 25 Sep 2021 16:42:44 +0100 Subject: [PATCH] Support multiple dividers per answer option set --- app/views/form/_checkbox_question.html.erb | 2 +- app/views/form/_radio_question.html.erb | 2 +- config/forms/2021_2022.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/form/_checkbox_question.html.erb b/app/views/form/_checkbox_question.html.erb index 1c379f3e3..144adad56 100644 --- a/app/views/form/_checkbox_question.html.erb +++ b/app/views/form/_checkbox_question.html.erb @@ -3,7 +3,7 @@ hint: { text: question["hint_text"] } do %> <% question["answer_options"].map do |key, val| %> - <% if key == "divider" %> + <% if key.starts_with?("divider") %> <%= f.govuk_check_box_divider %> <% else %> <%= f.govuk_check_box question_key, key, label: { text: val } %> diff --git a/app/views/form/_radio_question.html.erb b/app/views/form/_radio_question.html.erb index c6cd8cae0..9e553b13a 100644 --- a/app/views/form/_radio_question.html.erb +++ b/app/views/form/_radio_question.html.erb @@ -3,7 +3,7 @@ hint: { text: question["hint_text"] } do %> <% question["answer_options"].map do |key, val| %> - <% if key == "divider" %> + <% if key.starts_with?("divider") %> <%= f.govuk_radio_divider %> <% else %> <%= f.govuk_radio_button question_key, key, label: { text: val } %> diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index 8beedd445..83d80674a 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -368,9 +368,9 @@ "2": "Level access housing", "3": "Other disability requirements", "4": "No disability requirements", - "divider": true, + "divider_a": true, "5": "Do not know", - "divider": true, + "divider_b": true, "6": "Prefer not to say" } }