Skip to content

Commit

Permalink
fix formatting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
di-fabs committed May 13, 2024
1 parent 957e6e4 commit 89e9b64
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 36 deletions.
61 changes: 26 additions & 35 deletions src/components/common/layout/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -62,41 +62,32 @@
html: phaseBannerText
}) }}
{% block beforeContent %}{% endblock %}

<div class="govuk-width-container">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
{% if showBack %}
{{ govukBackLink({
text: "general.back" | translate,
href: hrefBack
}) }}
{% endif %}
</div>
<div class="govuk-grid-column-one-third last-item">
{% if showLanguageToggle %}
{{ languageSelect({
ariaLabel: 'general.base.languageToggle.ariaLabel' | translate,
url: currentUrl,
activeLanguage: htmlLang,
class: "govuk-!-margin-bottom-1",
languages: [
{
code: 'en',
text: 'English',
visuallyHidden: 'Change to English'
},
{
code:'cy',
text: 'Cymraeg',
visuallyHidden: 'Newid yr iaith ir Gymraeg'
}]
})
}}
{% endif %}
</div>
</div>
</div>
{% if showLanguageToggle %}
{{ languageSelect({
ariaLabel: 'general.base.languageToggle.ariaLabel' | translate,
url: currentUrl,
activeLanguage: htmlLang,
class: "govuk-!-margin-bottom-1",
languages: [
{
code: 'en',
text: 'English',
visuallyHidden: 'Change to English'
},
{
code:'cy',
text: 'Cymraeg',
visuallyHidden: 'Newid yr iaith ir Gymraeg'
}]
})
}}
{% endif %}
{% if showBack %}
{{ govukBackLink({
text: "general.back" | translate,
href: hrefBack
}) }}
{% endif %}
<main class="govuk-main-wrapper {{ mainClasses }}" id="main-content" role="main"{% if mainLang %} lang="{{ mainLang }}"{% endif %}>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds {{ rowClasses }}">
Expand Down
4 changes: 3 additions & 1 deletion src/middleware/language-toggle-middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export function languageToggleMiddleware(
): void {
res.locals.htmlLang = req.i18n.language;
res.locals.showLanguageToggle = process.env.LANGUAGE_TOGGLE === "1";
res.locals.currentUrl = new URL(req.protocol + "://" + req.get("host") + req.originalUrl);
res.locals.currentUrl = new URL(
req.protocol + "://" + req.get("host") + req.originalUrl
);
next();
}

0 comments on commit 89e9b64

Please sign in to comment.