-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
59 additions
and
65 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<script defer type="module" nonce="@Context.Items["nonce"]"> | ||
import * as govuk from '/js/govuk-frontend.min.js'; | ||
govuk.initAll(); | ||
function showHiddenElement(element) { | ||
element.classList.remove("govuk-visually-hidden"); | ||
element.ariaHidden = undefined; | ||
} | ||
// unhide all js-only elements when js is enabled | ||
[...document.getElementsByClassName("js-only")].forEach(showHiddenElement) | ||
</script> |
10 changes: 10 additions & 0 deletions
10
src/Dfe.ContentSupport.Web/Views/Shared/_CsBeforeContent.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@using Dfe.ContentSupport.Web.Configuration | ||
@inject TrackingOptions TrackingOptions | ||
|
||
<!-- Google Tag Manager (noscript) --> | ||
<noscript> | ||
<iframe src=@($"https://www.googletagmanager.com/ns.html?id={TrackingOptions.Gtm}") height="0" width="0" | ||
style="display:none;visibility:hidden" title="cs_gtm"> | ||
</iframe> | ||
</noscript> | ||
<!-- End Google Tag Manager (noscript) --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
<div class="dfe-header"> | ||
<div class="dfe-width-container dfe-header__container"> | ||
<div class="dfe-header__logo"> | ||
<a class="dfe-header__link dfe-header__link--service " href="/self-assessment" aria-label="DfE homepage"> | ||
<img src="/assets/images/dfe-logo.png" class="dfe-logo" alt="DfE Homepage"> | ||
<img src="/assets/images/dfe-logo-alt.png" class="dfe-logo-hover" alt="DfE Homepage"> | ||
</a> | ||
<header role="banner"> | ||
<partial name="CookiesBanner/_CookieBanner" /> | ||
<div class="dfe-header"> | ||
<div class="dfe-width-container dfe-header__container"> | ||
<div class="dfe-header__logo"> | ||
<a class="dfe-header__link dfe-header__link--service " href="/" aria-label="DfE homepage"> | ||
<img src="/assets/images/dfe-logo.png" class="dfe-logo" alt="DfE Homepage"> | ||
<img src="/assets/images/dfe-logo-alt.png" class="dfe-logo-hover" alt="DfE Homepage"> | ||
</a> | ||
</div> | ||
</div> | ||
<div class="dfe-width-container dfe-header__service-name"> | ||
<a href="/self-assessment" class="dfe-header__link--service">Plan technology for your school</a> | ||
</div> | ||
</div> | ||
<div class="dfe-width-container dfe-header__service-name"> | ||
<a href="/self-assessment" class="dfe-header__link--service">Plan technology for your school</a> | ||
</div> | ||
</div> | ||
<partial name="_Hero" model="@Model.Heading"/> | ||
</header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,37 @@ | ||
@using Dfe.ContentSupport.Web.Configuration | ||
@inject TrackingOptions TrackingOptions | ||
@model CsPage; | ||
|
||
@{ | ||
Layout = "_GovUkPageTemplate"; | ||
ViewData["Title"] = Model.Heading.Title; | ||
ViewData["containerClasses"] = "dfe-width-container"; | ||
var consentCookie = Context.Request.Cookies[".AspNet.Consent"]; | ||
var track = consentCookie == "true"; | ||
} | ||
|
||
@section Head { | ||
@{ | ||
if (track) | ||
{ | ||
<!-- Google Tag Manager --> | ||
<script>(function (w, d, s, l, i) { | ||
w[l] = w[l] || []; w[l].push({ | ||
'gtm.start': | ||
new Date().getTime(), event: 'gtm.js' | ||
}); var f = d.getElementsByTagName(s)[0], | ||
j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src = | ||
'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); | ||
})(window, document, 'script', 'dataLayer', '@(TrackingOptions.Gtm)');</script> | ||
<!-- End Google Tag Manager --> | ||
} | ||
} | ||
<partial name="_Head"/> | ||
} | ||
|
||
@section Header { | ||
<link rel="stylesheet" as="style" href="~/css/application.css"> | ||
<link rel="stylesheet" as="style" href="~/css/cands-site.css"> | ||
<header role="banner"> | ||
<partial name="_CookieConsent"/> | ||
<partial name="_CsHeader"/> | ||
<partial name="_Hero" model="@Model.Heading"/> | ||
</header> | ||
@RenderSection("Header", false) | ||
<partial name="_CsHeader"/> | ||
@await RenderSectionAsync("Header", false) | ||
} | ||
|
||
@section BeforeContent { | ||
<script | ||
defer>document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' govuk-frontend-supported' : '');</script> | ||
|
||
@{ | ||
if (track) | ||
{ | ||
<!-- Google Tag Manager (noscript) --> | ||
<noscript> | ||
<iframe src=@($"https://www.googletagmanager.com/ns.html?id={TrackingOptions.Gtm}") height="0" width="0" | ||
style="display:none;visibility:hidden"> | ||
</iframe> | ||
</noscript> | ||
<!-- End Google Tag Manager (noscript) --> | ||
} | ||
} | ||
|
||
@RenderSection("BeforeContent", false) | ||
<partial name="_CsBeforeContent"/> | ||
@await RenderSectionAsync("BeforeContent", false) | ||
} | ||
|
||
|
||
@RenderBody() | ||
|
||
@section Footer { | ||
<partial name="_Footer"/> | ||
} | ||
|
||
@section BodyEnd { | ||
<script defer type="module" nonce="@Context.Items["nonce"]"> | ||
import * as govuk from '/js/govuk-frontend.min.js'; | ||
govuk.initAll(); | ||
function showHiddenElement(element) { | ||
element.classList.remove("govuk-visually-hidden"); | ||
element.ariaHidden = undefined; | ||
} | ||
// unhide all js-only elements when js is enabled | ||
[...document.getElementsByClassName("js-only")].forEach(showHiddenElement) | ||
</script> | ||
|
||
@RenderSection("BodyEnd", false) | ||
<partial name="_BodyEnd"/> | ||
@await RenderSectionAsync("BodyEnd", false) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@using Dfe.ContentSupport.Web.Configuration | ||
@inject TrackingOptions TrackingOptions | ||
|
||
|
||
<!-- Google Tag Manager --> | ||
<script>(function (w, d, s, l, i) { | ||
w[l] = w[l] || []; w[l].push({ | ||
'gtm.start': | ||
new Date().getTime(), event: 'gtm.js' | ||
}); var f = d.getElementsByTagName(s)[0], | ||
j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src = | ||
'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); | ||
})(window, document, 'script', 'dataLayer', '@(TrackingOptions.Gtm)');</script> | ||
<!-- End Google Tag Manager --> |