|
|
@ -18,22 +18,24 @@ |
|
|
|
legend: legend(question, page_header, conditional), |
|
|
|
legend: legend(question, page_header, conditional), |
|
|
|
hint: { text: question.hint_text&.html_safe } do %> |
|
|
|
hint: { text: question.hint_text&.html_safe } do %> |
|
|
|
|
|
|
|
|
|
|
|
<% question.displayed_answer_options(@log, current_user).map do |key, options| %> |
|
|
|
<% question.displayed_answer_options(@log, current_user).each_with_index do |(key, options), index| %> |
|
|
|
<% if key.starts_with?("divider") %> |
|
|
|
<% if key.starts_with?("divider") %> |
|
|
|
<%= f.govuk_radio_divider %> |
|
|
|
<%= f.govuk_radio_divider %> |
|
|
|
<% else %> |
|
|
|
<% else %> |
|
|
|
<% conditional_question = find_conditional_question(@page, question, key) %> |
|
|
|
<% conditional_question = find_conditional_question(@page, question, key) %> |
|
|
|
<% if conditional_question.nil? %> |
|
|
|
<% if conditional_question.nil? %> |
|
|
|
<%= f.govuk_radio_button question.id, |
|
|
|
<%= f.govuk_radio_button question.id.to_sym, |
|
|
|
key, |
|
|
|
key, |
|
|
|
label: { text: options["value"] }, |
|
|
|
label: { text: options["value"] }, |
|
|
|
hint: { text: options["hint"] }, |
|
|
|
hint: { text: options["hint"] }, |
|
|
|
|
|
|
|
link_errors: index.zero? ? true : nil, |
|
|
|
**stimulus_html_attributes(question) %> |
|
|
|
**stimulus_html_attributes(question) %> |
|
|
|
<% else %> |
|
|
|
<% else %> |
|
|
|
<%= f.govuk_radio_button question.id, |
|
|
|
<%= f.govuk_radio_button question.id.to_sym, |
|
|
|
key, |
|
|
|
key, |
|
|
|
label: { text: options["value"] }, |
|
|
|
label: { text: options["value"] }, |
|
|
|
hint: { text: options["hint"] }, |
|
|
|
hint: { text: options["hint"] }, |
|
|
|
|
|
|
|
link_errors: index.zero? ? true : nil, |
|
|
|
**stimulus_html_attributes(question) do %> |
|
|
|
**stimulus_html_attributes(question) do %> |
|
|
|
<%= render partial: "#{conditional_question.type}_question", locals: { |
|
|
|
<%= render partial: "#{conditional_question.type}_question", locals: { |
|
|
|
question: conditional_question, |
|
|
|
question: conditional_question, |
|
|
|