From 9d0512cae5f807cec674fa6a30a9b586947c1106 Mon Sep 17 00:00:00 2001 From: Dana Cotoran Date: Mon, 29 Nov 2021 17:25:49 +0000 Subject: [PATCH] Account layout for "manage your account" active When the account layout template renders with a nav, the "Your account" nav option is selected by default. Some pages which use the account layout belong under "Manage your account" instead of "Your account". This allows us the option to render the account layout with "Manage your account" selected/active in the account nav, instead of the default "Your account". --- app/controllers/root_controller.rb | 1 + app/views/root/_account.html.erb | 3 ++- app/views/root/_gem_base.html.erb | 1 + ..._layout_account_manager_manage_your_account_active.html.erb | 3 +++ docs/slimmer_templates.md | 3 +++ 5 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 app/views/root/gem_layout_account_manager_manage_your_account_active.html.erb diff --git a/app/controllers/root_controller.rb b/app/controllers/root_controller.rb index 5d2b3bfd2..1819236a1 100644 --- a/app/controllers/root_controller.rb +++ b/app/controllers/root_controller.rb @@ -25,6 +25,7 @@ class RootController < ApplicationController campaign gem_layout gem_layout_account_manager + gem_layout_account_manager_manage_your_account_active gem_layout_account_manager_no_nav gem_layout_explore_header gem_layout_full_width diff --git a/app/views/root/_account.html.erb b/app/views/root/_account.html.erb index ccfbaba1d..c5169aabd 100644 --- a/app/views/root/_account.html.erb +++ b/app/views/root/_account.html.erb @@ -1,10 +1,11 @@ <% omit_account_navigation ||= nil + account_nav_location ||= "your-account" di_location = "https://signin.account.gov.uk" %> <%= render partial: "gem_base", locals: { - account_nav_location: "your-account", + account_nav_location: account_nav_location, omit_feedback_form: true, omit_footer_border: true, omit_global_banner: true, diff --git a/app/views/root/_gem_base.html.erb b/app/views/root/_gem_base.html.erb index 581d5aee0..10803c686 100644 --- a/app/views/root/_gem_base.html.erb +++ b/app/views/root/_gem_base.html.erb @@ -47,6 +47,7 @@ module: "explicit-cross-domain-links", link_for: "accounts-signed-in", }, + active: show_account_layout, }, { text: "Sign out", diff --git a/app/views/root/gem_layout_account_manager_manage_your_account_active.html.erb b/app/views/root/gem_layout_account_manager_manage_your_account_active.html.erb new file mode 100644 index 000000000..e6eba40f8 --- /dev/null +++ b/app/views/root/gem_layout_account_manager_manage_your_account_active.html.erb @@ -0,0 +1,3 @@ +<%= render partial: "account", locals: { + account_nav_location: "manage", +} %> diff --git a/docs/slimmer_templates.md b/docs/slimmer_templates.md index 91f62c2af..dc9cad963 100644 --- a/docs/slimmer_templates.md +++ b/docs/slimmer_templates.md @@ -20,6 +20,9 @@ This layout omits the default feedback component for GOVUK as the account pages Same as the `gem_layout_account_manager`, but displays without the account nav component. +## `gem_layout_account_manager_manage_your_account_active` + +Same as the `gem_layout_account_manager`, but displays "Manage your account" as active in the [account navigation component](https://components.publishing.service.gov.uk/component-guide/layout_for_public/with_current_account_navigation/preview). ## `core_layout` (default)