Skip to content

Commit

Permalink
Replace mojPrimaryNavigation with govukServiceNavigation
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwhatley committed Dec 13, 2024
1 parent 271a84b commit ca40fb4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 64 deletions.
1 change: 0 additions & 1 deletion app/assets/sass/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ $govuk-assets-path: "/dist/govuk/assets/";
@import "overrides/moj-button-menu";
@import "overrides/moj-filter";
@import "overrides/moj-pagination";
@import "overrides/moj-primary-navigation";
@import "overrides/status-grid";
@import "overrides/summary-card";
@import "overrides/tabs";
Expand Down
23 changes: 0 additions & 23 deletions app/assets/sass/overrides/_moj-primary-navigation.scss

This file was deleted.

54 changes: 14 additions & 40 deletions app/views/layout.njk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
{% from "govuk/components/phase-banner/macro.njk" import govukPhaseBanner %}
{% from "govuk/components/radios/macro.njk" import govukRadios %}
{% from "govuk/components/select/macro.njk" import govukSelect %}
{% from "govuk/components/service-navigation/macro.njk" import govukServiceNavigation %}
{% from "govuk/components/skip-link/macro.njk" import govukSkipLink %}
{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %}
{% from "govuk/components/table/macro.njk" import govukTable %}
Expand Down Expand Up @@ -53,7 +54,6 @@
{%- from "moj/components/filter/macro.njk" import mojFilter -%}
{%- from "moj/components/button-menu/macro.njk" import mojButtonMenu -%}
{%- from "moj/components/pagination/macro.njk" import mojPagination -%}
{%- from "moj/components/primary-navigation/macro.njk" import mojPrimaryNavigation -%}

{% block head %}
{% include "_includes/head.njk" %}
Expand Down Expand Up @@ -84,13 +84,9 @@
containerClasses: "govuk-width-container",
navigation: [
{
href: "#1",
href: "#",
text: "Your account"
} if false,
{
href: "/select-organisation",
text: "Change organisation"
} if shouldShowOrganisationSwitchLink and false,
},
{
href: "/start-page",
text: "Sign out"
Expand All @@ -102,27 +98,6 @@
{% include "_includes/organisation-switcher.njk" %}
{% endif %}

{% set rightHandSideNavHtml %}

{% if not data.isAdmin and not data.isImpersonating | falsify and not isSupportUi %}
{% set providerName = data.settings.userActiveProvider %}

<nav class="moj-primary-navigation">
<ul class="moj-primary-navigation__list">
{% set ariaCurrent = "aria-current=page" if navActive == "provider" %}
<li class="moj-primary-navigation__item">
<a class="moj-primary-navigation__link" {{ ariaCurrent }} href="/organisations/{{activeProvider.id}}">
Organisation details
</a>
</li>

</ul>

</nav>
{% endif %}

{% endset %}

{% set navItemsUser = [
{
text: 'Home',
Expand Down Expand Up @@ -167,8 +142,13 @@
{
text: 'Funding',
href: '/funding/' + data.years.currentAcademicYearSimple + '/payment-schedule',
active: true if navActive == 'Funding'
} if data.settings.showFundingInPrimaryNav
active: true if navActive == 'funding'
} if data.settings.showFundingInPrimaryNav,
{
text: 'Organisation details',
href: '/organisations/' + activeProvider.id,
active: true if navActive == 'provider'
} if not data.isAdmin and not data.isImpersonating | falsify and not isSupportUi
] | removeEmpty %}

{% set navItemsSupport = [
Expand Down Expand Up @@ -233,17 +213,13 @@

{% if not hidePrimaryNav %}

{{ mojPrimaryNavigation({
label: 'Primary navigation',
items: navItems,
containerClasses: "app-primary-navigation--support-ui" if isSupportUi,
searchHtml: rightHandSideNavHtml
{{ govukServiceNavigation({
ariaLabel: "Primary navigation",
navigation: navItems
}) }}

{% endif %}



{% endblock %}

{% block beforeContent %}
Expand All @@ -253,7 +229,7 @@
"role": "status"
},
tag: {
text: "prototype"
text: "Prototype"
},
classes: 'govuk-!-margin-top-1',
html: 'This is a prototype of a new service – your <a href="#" class="govuk-link">feedback</a> will help us improve it'
Expand Down Expand Up @@ -286,9 +262,7 @@
<h2 class="govuk-heading-s">
Give feedback
</h2>

<p class="govuk-body govuk-!-font-size-16"><a href="/guidance" class="govuk-link govuk-footer__link">Give feedback to help us improve <span class="app-nowrap">Register trainee teachers</span></a></p>

</div>
</div>
{% endset %}
Expand Down

0 comments on commit ca40fb4

Please sign in to comment.