Browse Source

CLDC-1400-error-summary-above-heading (#806)

* moved error summaries above headings for locations/schemes

* fix indentation
pull/808/head
Ted-U 2 years ago committed by GitHub
parent
commit
0e029d8b0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/views/locations/edit.html.erb
  2. 4
      app/views/locations/edit_name.html.erb
  3. 4
      app/views/locations/new.html.erb
  4. 5
      app/views/schemes/check_answers.html.erb
  5. 4
      app/views/schemes/details.html.erb
  6. 4
      app/views/schemes/edit_name.html.erb
  7. 10
      app/views/schemes/new.html.erb
  8. 4
      app/views/schemes/primary_client_group.html.erb
  9. 4
      app/views/schemes/secondary_client_group.html.erb
  10. 4
      app/views/schemes/support.html.erb

4
app/views/locations/edit.html.erb

@ -7,13 +7,13 @@
) %> ) %>
<% end %> <% end %>
<%= render partial: "organisations/headings", locals: { main: "Add a location to this scheme", sub: @scheme.service_name } %>
<%= form_for(@location, method: :patch, url: location_path) do |f| %> <%= form_for(@location, method: :patch, url: location_path) do |f| %>
<div class="govuk-grid-row"> <div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds"> <div class="govuk-grid-column-two-thirds">
<%= f.govuk_error_summary %> <%= f.govuk_error_summary %>
<%= render partial: "organisations/headings", locals: { main: "Add a location to this scheme", sub: @scheme.service_name } %>
<%= f.govuk_text_field :postcode, <%= f.govuk_text_field :postcode,
label: { size: "m" }, label: { size: "m" },
hint: { text: I18n.t("hints.location.postcode") }, hint: { text: I18n.t("hints.location.postcode") },

4
app/views/locations/edit_name.html.erb

@ -7,13 +7,13 @@
) %> ) %>
<% end %> <% end %>
<%= render partial: "organisations/headings", locals: { main: "Location name for #{@location.postcode}", sub: @scheme.service_name } %>
<%= form_for(@location, method: :patch, url: location_path(location_id: @location.id)) do |f| %> <%= form_for(@location, method: :patch, url: location_path(location_id: @location.id)) do |f| %>
<div class="govuk-grid-row"> <div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds"> <div class="govuk-grid-column-two-thirds">
<%= f.govuk_error_summary %> <%= f.govuk_error_summary %>
<%= render partial: "organisations/headings", locals: { main: "Location name for #{@location.postcode}", sub: @scheme.service_name } %>
<%= f.govuk_text_field :name, <%= f.govuk_text_field :name,
label: { hidden: true }, label: { hidden: true },
hint: { text: "This is how you refer to this location within your organisation" } %> hint: { text: "This is how you refer to this location within your organisation" } %>

4
app/views/locations/new.html.erb

@ -7,13 +7,13 @@
) %> ) %>
<% end %> <% end %>
<%= render partial: "organisations/headings", locals: { main: "Add a location to this scheme", sub: @scheme.service_name } %>
<%= form_for(@location, method: :post, url: locations_path) do |f| %> <%= form_for(@location, method: :post, url: locations_path) do |f| %>
<div class="govuk-grid-row"> <div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds"> <div class="govuk-grid-column-two-thirds">
<%= f.govuk_error_summary %> <%= f.govuk_error_summary %>
<%= render partial: "organisations/headings", locals: { main: "Add a location to this scheme", sub: @scheme.service_name } %>
<%= f.govuk_text_field :postcode, <%= f.govuk_text_field :postcode,
label: { size: "m" }, label: { size: "m" },
hint: { text: I18n.t("hints.location.postcode") }, hint: { text: I18n.t("hints.location.postcode") },

5
app/views/schemes/check_answers.html.erb

@ -1,8 +1,9 @@
<%= form_for(@scheme, as: :scheme, method: :patch) do |f| %>
<%= f.govuk_error_summary %>
<% content_for :title, "Check your answers before creating this scheme" %> <% content_for :title, "Check your answers before creating this scheme" %>
<%= render partial: "organisations/headings", locals: { main: "Check your changes before creating this scheme", sub: @scheme.service_name } %> <%= render partial: "organisations/headings", locals: { main: "Check your changes before creating this scheme", sub: @scheme.service_name } %>
<%= form_for(@scheme, as: :scheme, method: :patch) do |f| %>
<%= f.govuk_error_summary %>
<%= govuk_tabs(title: "Check your answers before creating this scheme") do |component| %> <%= govuk_tabs(title: "Check your answers before creating this scheme") do |component| %>
<% component.tab(label: "Scheme") do %> <% component.tab(label: "Scheme") do %>
<h2 class="govuk-visually-hidden">Scheme</h2> <h2 class="govuk-visually-hidden">Scheme</h2>

4
app/views/schemes/details.html.erb

@ -7,13 +7,13 @@
) %> ) %>
<% end %> <% end %>
<%= render partial: "organisations/headings", locals: { main: "Create a new supported housing scheme", sub: nil } %>
<%= form_for(@scheme, method: :patch) do |f| %> <%= form_for(@scheme, method: :patch) do |f| %>
<div class="govuk-grid-row"> <div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds"> <div class="govuk-grid-column-two-thirds">
<%= f.govuk_error_summary %> <%= f.govuk_error_summary %>
<%= render partial: "organisations/headings", locals: { main: "Create a new supported housing scheme", sub: nil } %>
<%= f.govuk_text_field :service_name, <%= f.govuk_text_field :service_name,
label: { text: "Scheme name", size: "m" }, label: { text: "Scheme name", size: "m" },
hint: { text: "This is how you refer to this supported housing scheme within your organisation. For example, the name could relate to the address or location. You’ll be able to see the client group when selecting it." } %> hint: { text: "This is how you refer to this supported housing scheme within your organisation. For example, the name could relate to the address or location. You’ll be able to see the client group when selecting it." } %>

4
app/views/schemes/edit_name.html.erb

@ -7,13 +7,13 @@
) %> ) %>
<% end %> <% end %>
<%= render partial: "organisations/headings", locals: { main: "Scheme details", sub: @scheme.service_name } %>
<%= form_for(@scheme, method: :patch) do |f| %> <%= form_for(@scheme, method: :patch) do |f| %>
<div class="govuk-grid-row"> <div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds"> <div class="govuk-grid-column-two-thirds">
<%= f.govuk_error_summary %> <%= f.govuk_error_summary %>
<%= render partial: "organisations/headings", locals: { main: "Scheme details", sub: @scheme.service_name } %>
<%= f.govuk_text_field :service_name, <%= f.govuk_text_field :service_name,
label: { text: "Scheme name", size: "m" }, label: { text: "Scheme name", size: "m" },
hint: { text: "This is how you refer to this supported housing scheme within your organisation. For example, the name could relate to the address or location. You’ll be able to see the client group when selecting it." } %> hint: { text: "This is how you refer to this supported housing scheme within your organisation. For example, the name could relate to the address or location. You’ll be able to see the client group when selecting it." } %>

10
app/views/schemes/new.html.erb

@ -1,3 +1,8 @@
<%= form_for(@scheme, as: :scheme, method: :post) do |f| %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= f.govuk_error_summary %>
<% content_for :title, "Create a new supported housing scheme" %> <% content_for :title, "Create a new supported housing scheme" %>
<% content_for :before_content do %> <% content_for :before_content do %>
@ -7,11 +12,6 @@
) %> ) %>
<% end %> <% end %>
<%= form_for(@scheme, as: :scheme, method: :post) do |f| %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= f.govuk_error_summary %>
<h1 class="govuk-heading-l"> <h1 class="govuk-heading-l">
<%= content_for(:title) %> <%= content_for(:title) %>
</h1> </h1>

4
app/views/schemes/primary_client_group.html.erb

@ -15,13 +15,13 @@
) %> ) %>
<% end %> <% end %>
<%= render partial: "organisations/headings", locals: { main: "What client group is this scheme intended for?", sub: @scheme.service_name } %>
<%= form_for(@scheme, method: :patch) do |f| %> <%= form_for(@scheme, method: :patch) do |f| %>
<div class="govuk-grid-row"> <div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds"> <div class="govuk-grid-column-two-thirds">
<%= f.govuk_error_summary %> <%= f.govuk_error_summary %>
<%= render partial: "organisations/headings", locals: { main: "What client group is this scheme intended for?", sub: @scheme.service_name } %>
<% primary_client_group_selection = Scheme.primary_client_groups.keys.excluding("Missing").map { |key, _| OpenStruct.new(id: key, name: key) } %> <% primary_client_group_selection = Scheme.primary_client_groups.keys.excluding("Missing").map { |key, _| OpenStruct.new(id: key, name: key) } %>
<%= f.govuk_collection_radio_buttons :primary_client_group, <%= f.govuk_collection_radio_buttons :primary_client_group,
primary_client_group_selection, primary_client_group_selection,

4
app/views/schemes/secondary_client_group.html.erb

@ -7,13 +7,13 @@
) %> ) %>
<% end %> <% end %>
<%= render partial: "organisations/headings", locals: { main: "What is the other client group?", sub: @scheme.service_name } %>
<%= form_for(@scheme, method: :patch) do |f| %> <%= form_for(@scheme, method: :patch) do |f| %>
<div class="govuk-grid-row"> <div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds"> <div class="govuk-grid-column-two-thirds">
<%= f.govuk_error_summary %> <%= f.govuk_error_summary %>
<%= render partial: "organisations/headings", locals: { main: "What is the other client group?", sub: @scheme.service_name } %>
<% secondary_client_group_selection = Scheme.secondary_client_groups.keys.excluding("Missing").map { |key, _| OpenStruct.new(id: key, name: key) } %> <% secondary_client_group_selection = Scheme.secondary_client_groups.keys.excluding("Missing").map { |key, _| OpenStruct.new(id: key, name: key) } %>
<%= f.govuk_collection_radio_buttons :secondary_client_group, <%= f.govuk_collection_radio_buttons :secondary_client_group,
secondary_client_group_selection, secondary_client_group_selection,

4
app/views/schemes/support.html.erb

@ -7,13 +7,13 @@
) %> ) %>
<% end %> <% end %>
<%= render partial: "organisations/headings", locals: { main: "What support does this scheme provide?", sub: @scheme.service_name } %>
<%= form_for(@scheme, method: :patch) do |f| %> <%= form_for(@scheme, method: :patch) do |f| %>
<div class="govuk-grid-row"> <div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds"> <div class="govuk-grid-column-two-thirds">
<%= f.govuk_error_summary %> <%= f.govuk_error_summary %>
<%= render partial: "organisations/headings", locals: { main: "What support does this scheme provide?", sub: @scheme.service_name } %>
<% support_level_options_hints = { "Low level": "Staff visiting once a week, fortnightly or less.", "Medium level": "Staff on site daily or making frequent visits with some out-of-hours cover.", "High level": "Intensive level of staffing provided on a 24-hour basis." } %> <% support_level_options_hints = { "Low level": "Staff visiting once a week, fortnightly or less.", "Medium level": "Staff on site daily or making frequent visits with some out-of-hours cover.", "High level": "Intensive level of staffing provided on a 24-hour basis." } %>
<% support_level_options_with_hints = Scheme.support_types.keys.excluding("Missing").map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize, description: support_level_options_hints[key.to_sym]) } %> <% support_level_options_with_hints = Scheme.support_types.keys.excluding("Missing").map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize, description: support_level_options_hints[key.to_sym]) } %>

Loading…
Cancel
Save