From f28981aa2078ed071d7404bd1d829bd9bfce314c Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Tue, 21 Jun 2022 13:03:44 +0100 Subject: [PATCH] Fix placement of back links on scheme pages (#685) --- app/views/devise/confirmations/new.html.erb | 5 +---- app/views/devise/passwords/edit.html.erb | 5 +---- app/views/devise/passwords/new.html.erb | 5 +---- app/views/devise/passwords/reset_password.html.erb | 5 +---- app/views/devise/two_factor_authentication/resend.html.erb | 5 +---- app/views/form/page.html.erb | 5 +---- app/views/organisations/edit.html.erb | 5 +---- app/views/organisations/new.html.erb | 5 +---- app/views/schemes/locations.html.erb | 4 +++- app/views/schemes/show.html.erb | 4 +++- app/views/users/edit.html.erb | 5 +---- app/views/users/new.html.erb | 5 +---- 12 files changed, 16 insertions(+), 42 deletions(-) diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb index 1b9ca13ea..0f44c394f 100644 --- a/app/views/devise/confirmations/new.html.erb +++ b/app/views/devise/confirmations/new.html.erb @@ -1,10 +1,7 @@ <% content_for :title, "Resend invitation link" %> <% content_for :before_content do %> - <%= govuk_back_link( - text: "Back", - href: :back, - ) %> + <%= govuk_back_link(href: :back) %> <% end %> <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb index 7d6babca3..94ef6f44c 100644 --- a/app/views/devise/passwords/edit.html.erb +++ b/app/views/devise/passwords/edit.html.erb @@ -1,10 +1,7 @@ <% content_for :title, "Change your password" %> <% content_for :before_content do %> - <%= govuk_back_link( - text: "Back", - href: :back, - ) %> + <%= govuk_back_link(href: :back) %> <% end %> <%= form_for(resource, as: resource_name, html: { method: :patch }) do |f| %> diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index b677b4c17..b59d77cd0 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -1,10 +1,7 @@ <% content_for :title, "Reset password" %> <% content_for :before_content do %> - <%= govuk_back_link( - text: "Back", - href: :back, - ) %> + <%= govuk_back_link(href: :back) %> <% end %> <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> diff --git a/app/views/devise/passwords/reset_password.html.erb b/app/views/devise/passwords/reset_password.html.erb index 307876386..26ee6f590 100644 --- a/app/views/devise/passwords/reset_password.html.erb +++ b/app/views/devise/passwords/reset_password.html.erb @@ -1,10 +1,7 @@ <% content_for :title, @confirmation ? I18n.t("user.create_password") : I18n.t("user.reset_password") %> <% content_for :before_content do %> - <%= govuk_back_link( - text: "Back", - href: :back, - ) %> + <%= govuk_back_link(href: :back) %> <% end %> <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> diff --git a/app/views/devise/two_factor_authentication/resend.html.erb b/app/views/devise/two_factor_authentication/resend.html.erb index a2cc00198..0c7cdd32a 100644 --- a/app/views/devise/two_factor_authentication/resend.html.erb +++ b/app/views/devise/two_factor_authentication/resend.html.erb @@ -1,10 +1,7 @@ <% content_for :title, "Resend security code" %> <% content_for :before_content do %> - <%= govuk_back_link( - text: "Back", - href: "javascript:history.back()", - ) %> + <%= govuk_back_link(href: "javascript:history.back()") %> <% end %> <%= form_with(url: send("resend_code_#{resource_name}_two_factor_authentication_path"), html: { method: :get }) do |f| %> diff --git a/app/views/form/page.html.erb b/app/views/form/page.html.erb index ebbdd681b..f4f5fe9ae 100644 --- a/app/views/form/page.html.erb +++ b/app/views/form/page.html.erb @@ -1,10 +1,7 @@ <% content_for :title, @page.header.presence || @page.questions.first.header.html_safe %> <% content_for :before_content do %> - <%= govuk_back_link( - text: "Back", - href: "javascript:history.back()", - ) %> + <%= govuk_back_link(href: "javascript:history.back()") %> <% end %>
diff --git a/app/views/organisations/edit.html.erb b/app/views/organisations/edit.html.erb index 93dafc4a7..c217d26ad 100644 --- a/app/views/organisations/edit.html.erb +++ b/app/views/organisations/edit.html.erb @@ -1,10 +1,7 @@ <% content_for :title, "Change #{@organisation.name}’s details" %> <% content_for :before_content do %> - <%= govuk_back_link( - text: "Back", - href: :back, - ) %> + <%= govuk_back_link(href: :back) %> <% end %> <%= form_for(@organisation, as: :organisation, html: { method: :patch }) do |f| %> diff --git a/app/views/organisations/new.html.erb b/app/views/organisations/new.html.erb index 746c7770d..5d1747ed7 100644 --- a/app/views/organisations/new.html.erb +++ b/app/views/organisations/new.html.erb @@ -1,10 +1,7 @@ <% content_for :title, "Create a new organisation" %> <% content_for :before_content do %> - <%= govuk_back_link( - text: "Back", - href: :back, - ) %> + <%= govuk_back_link(href: :back) %> <% end %> <%= form_for(@resource, as: :organisation, html: { method: :post }) do |f| %> diff --git a/app/views/schemes/locations.html.erb b/app/views/schemes/locations.html.erb index 3a3f13125..4f85bec1c 100644 --- a/app/views/schemes/locations.html.erb +++ b/app/views/schemes/locations.html.erb @@ -1,7 +1,9 @@ <% title = @scheme.service_name %> <% content_for :title, title %> -<%= govuk_back_link(href: request.referer.to_s) %> +<% content_for :before_content do %> + <%= govuk_back_link(href: request.referer.to_s) %> +<% end %> <%= render partial: "organisations/headings", locals: { main: @scheme.service_name, sub: nil } %> diff --git a/app/views/schemes/show.html.erb b/app/views/schemes/show.html.erb index dd1ceda70..561f986de 100644 --- a/app/views/schemes/show.html.erb +++ b/app/views/schemes/show.html.erb @@ -1,7 +1,9 @@ <% title = @scheme.service_name %> <% content_for :title, title %> -<%= govuk_back_link(href: request.referer.to_s) %> +<% content_for :before_content do %> + <%= govuk_back_link(href: request.referer.to_s) %> +<% end %> <%= render partial: "organisations/headings", locals: { main: @scheme.service_name, sub: nil } %> diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 900ca3a69..1c45b9a67 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -1,10 +1,7 @@ <% content_for :title, current_user == @user ? "Change your personal details" : "Change #{@user.name.presence || 'this user'}’s personal details" %> <% content_for :before_content do %> - <%= govuk_back_link( - text: "Back", - href: :back, - ) %> + <%= govuk_back_link(href: :back) %> <% end %> <%= form_for(@user, as: :user, html: { method: :patch }) do |f| %> diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 3880a1e9f..2b3db667e 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -1,10 +1,7 @@ <% content_for :title, "Invite somebody to submit CORE data" %> <% content_for :before_content do %> - <%= govuk_back_link( - text: "Back", - href: :back, - ) %> + <%= govuk_back_link(href: :back) %> <% end %> <%= form_for(@resource, as: :user, html: { method: :post }) do |f| %>