Browse Source

Ensure error summary on question pages appears above page title

pull/278/head
Paul Robert Lloyd 3 years ago
parent
commit
ade5eb314f
  1. 37
      app/views/form/page.html.erb

37
app/views/form/page.html.erb

@ -14,24 +14,25 @@
<div data-controller="govukfrontend"></div> <div data-controller="govukfrontend"></div>
<%= turbo_frame_tag "case_log_form", target: "_top" do %> <%= turbo_frame_tag "case_log_form", target: "_top" do %>
<div class="govuk-grid-row"> <%= form_with model: @case_log, url: form_case_log_path(@case_log), method: "post" do |f| %>
<div class="govuk-grid-column-two-thirds-from-desktop"> <div class="govuk-grid-row">
<% if @page.header.present? %> <div class="govuk-grid-column-two-thirds-from-desktop">
<h1 class="govuk-heading-l">
<% if !@page.hide_subsection_label %>
<span class="govuk-caption-l"><%= @subsection.label %></span>
<% end %>
<%= @page.header %>
</h1>
<% end %>
<% if @page.description.present? %>
<p class="govuk-body govuk-body-m"><%= @page.description.html_safe %></p>
<% end %>
<%= form_with model: @case_log, url: form_case_log_path(@case_log), method: "post" do |f| %>
<% remove_other_page_errors(@case_log, @page) %> <% remove_other_page_errors(@case_log, @page) %>
<%= f.govuk_error_summary %> <%= f.govuk_error_summary %>
<% if @page.header.present? %>
<h1 class="govuk-heading-l">
<% if !@page.hide_subsection_label %>
<span class="govuk-caption-l"><%= @subsection.label %></span>
<% end %>
<%= @page.header %>
</h1>
<% end %>
<% if @page.description.present? %>
<p class="govuk-body govuk-body-m"><%= @page.description.html_safe %></p>
<% end %>
<% @page.non_conditional_questions.map do |question| %> <% @page.non_conditional_questions.map do |question| %>
<div id=<%= question.id + "_div " %><%= display_question_key_div(@page, question) %> > <div id=<%= question.id + "_div " %><%= display_question_key_div(@page, question) %> >
<% if question.read_only? %> <% if question.read_only? %>
@ -47,7 +48,7 @@
<%= f.hidden_field :page, value: @page.id %> <%= f.hidden_field :page, value: @page.id %>
<%= f.govuk_submit "Save and continue" %> <%= f.govuk_submit "Save and continue" %>
<% end %> </div>
</div> </div>
</div> <% end %>
<% end %> <% end %>

Loading…
Cancel
Save