From ade5eb314f7a799955d8e4daa1874d46a81ea96b Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Mon, 7 Feb 2022 17:17:09 +0000 Subject: [PATCH] Ensure error summary on question pages appears above page title --- app/views/form/page.html.erb | 37 ++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/app/views/form/page.html.erb b/app/views/form/page.html.erb index 29c784b43..893cd10dc 100644 --- a/app/views/form/page.html.erb +++ b/app/views/form/page.html.erb @@ -14,24 +14,25 @@
<%= turbo_frame_tag "case_log_form", target: "_top" do %> -
-
- <% if @page.header.present? %> -

- <% if !@page.hide_subsection_label %> - <%= @subsection.label %> - <% end %> - <%= @page.header %> -

- <% end %> - - <% if @page.description.present? %> -

<%= @page.description.html_safe %>

- <% end %> - - <%= form_with model: @case_log, url: form_case_log_path(@case_log), method: "post" do |f| %> + <%= form_with model: @case_log, url: form_case_log_path(@case_log), method: "post" do |f| %> +
+
<% remove_other_page_errors(@case_log, @page) %> <%= f.govuk_error_summary %> + + <% if @page.header.present? %> +

+ <% if !@page.hide_subsection_label %> + <%= @subsection.label %> + <% end %> + <%= @page.header %> +

+ <% end %> + + <% if @page.description.present? %> +

<%= @page.description.html_safe %>

+ <% end %> + <% @page.non_conditional_questions.map do |question| %>
<%= display_question_key_div(@page, question) %> > <% if question.read_only? %> @@ -47,7 +48,7 @@ <%= f.hidden_field :page, value: @page.id %> <%= f.govuk_submit "Save and continue" %> - <% end %> +
-
+ <% end %> <% end %>