diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be7945..9ad342b8a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,5 @@ module ApplicationHelper + def browser_title(title) + [title, t("service_name"), "GOV.UK"].select(&:present?).join(" - ") + end end diff --git a/app/views/case_logs/edit.html.erb b/app/views/case_logs/edit.html.erb index 19b274488..0536c7cbe 100644 --- a/app/views/case_logs/edit.html.erb +++ b/app/views/case_logs/edit.html.erb @@ -1,4 +1,4 @@ -<% content_for :title, "Case log #{@case_log.id} – #{t('service_name')} - GOV.UK" %> +<% content_for :title, browser_title("Case log #{@case_log.id}") %> <%= turbo_frame_tag "case_log_form", target: "_top" do %>
diff --git a/app/views/case_logs/index.html.erb b/app/views/case_logs/index.html.erb index 639b5cc38..0581f7a6a 100644 --- a/app/views/case_logs/index.html.erb +++ b/app/views/case_logs/index.html.erb @@ -1,4 +1,4 @@ -<% content_for :title, "Case logs – #{t('service_name')} - GOV.UK" %> +<% content_for :title, browser_title("Case logs") %>

Your logs

diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 74bd0bcbd..4e0672ec1 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -1,4 +1,4 @@ -<% content_for :title, "Sign in – #{t('service_name')} - GOV.UK" %> +<% content_for :title, browser_title("Sign in") %> <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
diff --git a/app/views/form/check_answers.html.erb b/app/views/form/check_answers.html.erb index 2516a73d1..9cd37c5a2 100644 --- a/app/views/form/check_answers.html.erb +++ b/app/views/form/check_answers.html.erb @@ -1,4 +1,4 @@ -<% content_for :title, "Check answers – #{t('service_name')} - GOV.UK" %> +<% content_for :title, browser_title("Check answers") %> <%= turbo_frame_tag "case_log_form", target: "_top" do %>
diff --git a/app/views/form/page.html.erb b/app/views/form/page.html.erb index e7fe0c7e2..505924fbe 100644 --- a/app/views/form/page.html.erb +++ b/app/views/form/page.html.erb @@ -1,4 +1,4 @@ -<% content_for :title, "#{subsection} – #{t('service_name')} - GOV.UK" %> +<% content_for :title, browser_title(subsection) %> <% content_for :before_content do %> <%= govuk_back_link( diff --git a/app/views/organisations/show.html.erb b/app/views/organisations/show.html.erb index d9cac8d2a..3748e6cc0 100644 --- a/app/views/organisations/show.html.erb +++ b/app/views/organisations/show.html.erb @@ -1,4 +1,4 @@ -<% content_for :title, "Your organisation (Details) – #{t('service_name')} - GOV.UK" %> +<% content_for :title, browser_title("Your organisation (Details)") %> <% content_for :tab_title do %> <%= "Details" %> <% end %> diff --git a/app/views/organisations/users.html.erb b/app/views/organisations/users.html.erb index dbf53b484..653cfc569 100644 --- a/app/views/organisations/users.html.erb +++ b/app/views/organisations/users.html.erb @@ -1,4 +1,4 @@ -<% content_for :title, "Your organisation (Users) – #{t('service_name')} - GOV.UK" %> +<% content_for :title, browser_title("Your organisation (Users)") %> <% content_for :tab_title do %> <%= "Users" %> <% end %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index e90d35cdc..032938628 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,4 +1,4 @@ -<% content_for :title, "Your account – #{t('service_name')} - GOV.UK" %> +<% content_for :title, browser_title("Your account") %>