Skip to content

Commit

Permalink
chore: merged from development
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Whittington committed Sep 5, 2024
2 parents 9367c39 + 4ab2bba commit 4abb884
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
}
else
{
<a href="@Model.Uri" target="_blank" rel="noopener noreferrer"><partial name="RichText/_Text" model="@Model.Content.First()"/></a>
<a href="@Model.Uri" target="_blank" rel="noopener noreferrer"><partial name="RichText/_Text" model="@Model.Content[0]"/></a>
}
11 changes: 11 additions & 0 deletions src/Dfe.ContentSupport.Web/Views/Shared/_BodyEnd.cshtml
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 src/Dfe.ContentSupport.Web/Views/Shared/_CsBeforeContent.cshtml
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) -->
26 changes: 15 additions & 11 deletions src/Dfe.ContentSupport.Web/Views/Shared/_CsHeader.cshtml
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>
61 changes: 8 additions & 53 deletions src/Dfe.ContentSupport.Web/Views/Shared/_CsLayout.cshtml
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)
}
14 changes: 14 additions & 0 deletions src/Dfe.ContentSupport.Web/Views/Shared/_Head.cshtml
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 -->

0 comments on commit 4abb884

Please sign in to comment.