diff --git a/app/views/form/_checkbox_question.html.erb b/app/views/form/_checkbox_question.html.erb index b327e94d2..fa838293f 100644 --- a/app/views/form/_checkbox_question.html.erb +++ b/app/views/form/_checkbox_question.html.erb @@ -1,5 +1,6 @@ <%= f.govuk_check_boxes_fieldset question.id.to_sym, - legend: { text: question.header.html_safe, size: page_header.nil? ? "l" : "m", tag: page_header.nil? ? "h2" : "h1" }, + caption: caption && !page_header.present? ? { text: caption.html_safe, size: "l" } : nil, + legend: { text: question.header.html_safe, size: !page_header.present? ? "l" : "m", tag: !page_header.present? ? "h1" : "h2" }, 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 61eb34b2a..8ad0b459c 100644 --- a/app/views/form/_date_question.html.erb +++ b/app/views/form/_date_question.html.erb @@ -1,6 +1,7 @@ <%= f.govuk_date_field question.id.to_sym, + caption: caption && !page_header.present? ? { text: caption.html_safe, size: "l" } : nil, + legend: { text: question.header.html_safe, size: !page_header.present? ? "l" : "m", tag: !page_header.present? ? "h1" : "h2" }, hint: { text: question.hint_text }, - legend: { text: question.header.html_safe, size: page_header.nil? ? "l" : "m", tag: page_header.nil? ? "h2" : "h1" }, width: 20, **stimulus_html_attributes(question) %> diff --git a/app/views/form/_numeric_question.html.erb b/app/views/form/_numeric_question.html.erb index 5a75c46c8..2362c74b6 100644 --- a/app/views/form/_numeric_question.html.erb +++ b/app/views/form/_numeric_question.html.erb @@ -1,7 +1,8 @@ <%= f.govuk_number_field question.id.to_sym, + caption: caption && !page_header.present? ? { text: caption.html_safe, size: "l" } : nil, + label: { text: question.header.html_safe, size: !page_header.present? ? "l" : "m", tag: !page_header.present? ? "h1" : "h2" }, hint: { text: question.hint_text }, - label: { text: question.header.html_safe, size: page_header.nil? ? "l" : "m", tag: page_header.nil? ? "h2" : "h1" }, min: question.min, max: question.max, step: question.step, - width: 20, :readonly => question.read_only?, + width: question.width, :readonly => question.read_only?, **stimulus_html_attributes(question) %> diff --git a/app/views/form/_radio_question.html.erb b/app/views/form/_radio_question.html.erb index a922fc3e0..f92bfac13 100644 --- a/app/views/form/_radio_question.html.erb +++ b/app/views/form/_radio_question.html.erb @@ -1,7 +1,7 @@ <%= f.govuk_radio_buttons_fieldset question.id.to_sym, - legend: { text: question.header.html_safe, size: page_header.nil? ? "l" : "m", tag: page_header.nil? ? "h2" : "h1" }, - hint: { text: question.hint_text }, - small: (question.answer_options.size > 5) do %> + caption: caption && !page_header.present? ? { text: caption.html_safe, size: "l" } : nil, + legend: { text: question.header.html_safe, size: !page_header.present? ? "l" : "m", tag: !page_header.present? ? "h1" : "h2" }, + hint: { text: question.hint_text } do %> <% question.answer_options.map do |key, val| %> <% if key.starts_with?("divider") %> diff --git a/app/views/form/_select_question.html.erb b/app/views/form/_select_question.html.erb index b6c431286..a010c8adb 100644 --- a/app/views/form/_select_question.html.erb +++ b/app/views/form/_select_question.html.erb @@ -3,6 +3,7 @@ answers, :name, :name, - label: { text: question.header, size: page_header.nil? ? "l" : "m", tag: page_header.nil? ? "h2" : "h1" }, + caption: caption && !page_header.present? ? { text: caption.html_safe, size: "l" } : nil, + label: { text: question.header, size: !page_header.present? ? "l" : "m", tag: !page_header.present? ? "h1" : "h2" }, hint: { text: question.hint_text } %> diff --git a/app/views/form/_text_question.html.erb b/app/views/form/_text_question.html.erb index c062b7e62..6d5b015af 100644 --- a/app/views/form/_text_question.html.erb +++ b/app/views/form/_text_question.html.erb @@ -1,6 +1,7 @@ <%= f.govuk_text_field question.id.to_sym, + caption: caption && !page_header.present? ? { text: caption.html_safe, size: "l" } : nil, + label: { text: question.header.html_safe, size: !page_header.present? ? "l" : "m", tag: !page_header.present? ? "h1" : "h2" }, hint: { text: question.hint_text }, - label: { text: question.header.html_safe, size: page_header.nil? ? "l" : "m", tag: page_header.nil? ? "h2" : "h1" }, - width: 20, + width: question.width ? question.width : nil, **stimulus_html_attributes(question) %> diff --git a/app/views/form/check_answers.html.erb b/app/views/form/check_answers.html.erb index d2a2551d4..55cbeb0de 100644 --- a/app/views/form/check_answers.html.erb +++ b/app/views/form/check_answers.html.erb @@ -1,7 +1,10 @@ <%= turbo_frame_tag "case_log_form", target: "_top" do %>