Skip to content

Commit

Permalink
Account layout for "manage your account" active
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
danacotoran committed Nov 29, 2021
1 parent c06beb0 commit 9d0512c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/controllers/root_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion app/views/root/_account.html.erb
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
1 change: 1 addition & 0 deletions app/views/root/_gem_base.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
module: "explicit-cross-domain-links",
link_for: "accounts-signed-in",
},
active: show_account_layout,
},
{
text: "Sign out",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<%= render partial: "account", locals: {
account_nav_location: "manage",
} %>
3 changes: 3 additions & 0 deletions docs/slimmer_templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 9d0512c

Please sign in to comment.