Browse Source

Support multiple dividers per answer option set

pull/23/head
baarkerlounger 3 years ago
parent
commit
6053bcefd4
  1. 2
      app/views/form/_checkbox_question.html.erb
  2. 2
      app/views/form/_radio_question.html.erb
  3. 4
      config/forms/2021_2022.json

2
app/views/form/_checkbox_question.html.erb

@ -3,7 +3,7 @@
hint: { text: question["hint_text"] } do %> hint: { text: question["hint_text"] } do %>
<% question["answer_options"].map do |key, val| %> <% question["answer_options"].map do |key, val| %>
<% if key == "divider" %> <% if key.starts_with?("divider") %>
<%= f.govuk_check_box_divider %> <%= f.govuk_check_box_divider %>
<% else %> <% else %>
<%= f.govuk_check_box question_key, key, label: { text: val } %> <%= f.govuk_check_box question_key, key, label: { text: val } %>

2
app/views/form/_radio_question.html.erb

@ -3,7 +3,7 @@
hint: { text: question["hint_text"] } do %> hint: { text: question["hint_text"] } do %>
<% question["answer_options"].map do |key, val| %> <% question["answer_options"].map do |key, val| %>
<% if key == "divider" %> <% if key.starts_with?("divider") %>
<%= f.govuk_radio_divider %> <%= f.govuk_radio_divider %>
<% else %> <% else %>
<%= f.govuk_radio_button question_key, key, label: { text: val } %> <%= f.govuk_radio_button question_key, key, label: { text: val } %>

4
config/forms/2021_2022.json

@ -368,9 +368,9 @@
"2": "Level access housing", "2": "Level access housing",
"3": "Other disability requirements", "3": "Other disability requirements",
"4": "No disability requirements", "4": "No disability requirements",
"divider": true, "divider_a": true,
"5": "Do not know", "5": "Do not know",
"divider": true, "divider_b": true,
"6": "Prefer not to say" "6": "Prefer not to say"
} }
} }

Loading…
Cancel
Save