From b700a3d3368ad46508157f454423adac61f9db0a Mon Sep 17 00:00:00 2001 From: Ash Davies <3853061+DrizzlyOwl@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:52:01 +0000 Subject: [PATCH] Update GovUk Frontend to v2 --- .../Dfe.Academies.External.Web.csproj | 2 +- .../Pages/Shared/_Header.cshtml | 4 +- .../Pages/Shared/_Layout.cshtml | 139 ++++++++---------- .../Pages/_ViewImports.cshtml | 2 +- Dfe.Academies.External.Web/Program.cs | 2 +- 5 files changed, 65 insertions(+), 84 deletions(-) diff --git a/Dfe.Academies.External.Web/Dfe.Academies.External.Web.csproj b/Dfe.Academies.External.Web/Dfe.Academies.External.Web.csproj index 3f4232585..d5755a69f 100644 --- a/Dfe.Academies.External.Web/Dfe.Academies.External.Web.csproj +++ b/Dfe.Academies.External.Web/Dfe.Academies.External.Web.csproj @@ -22,9 +22,9 @@ - + diff --git a/Dfe.Academies.External.Web/Pages/Shared/_Header.cshtml b/Dfe.Academies.External.Web/Pages/Shared/_Header.cshtml index f4145f14a..2202f7094 100644 --- a/Dfe.Academies.External.Web/Pages/Shared/_Header.cshtml +++ b/Dfe.Academies.External.Web/Pages/Shared/_Header.cshtml @@ -21,9 +21,9 @@ - \ No newline at end of file + diff --git a/Dfe.Academies.External.Web/Pages/Shared/_Layout.cshtml b/Dfe.Academies.External.Web/Pages/Shared/_Layout.cshtml index 7a7a07608..889eecf91 100644 --- a/Dfe.Academies.External.Web/Pages/Shared/_Layout.cshtml +++ b/Dfe.Academies.External.Web/Pages/Shared/_Layout.cshtml @@ -1,5 +1,6 @@ @using Microsoft.Extensions.Configuration @using Microsoft.AspNetCore.Http.Features +@using GovUk.Frontend.AspNetCore @using System.Security.Claims; @inject IConfiguration _configuration @@ -47,7 +48,7 @@ } }, } }); - + // Set Authenticated User Context window.appInsights.setAuthenticatedUserContext("@authenticatedUserId", null, true); @@ -58,98 +59,78 @@ @ViewData["Title"] – Apply to become an academy - - - - - - - - + + + + + + @Html.GovUkFrontendStyleImports() -@if (canTrack) -{ - - - -} - - - - - + @Html.GovUkFrontendJsEnabledScript() - -
- @if (User.Identity is not null && User.Identity.IsAuthenticated) + @if (canTrack) { - + + + } -
- @await RenderSectionAsync("BeforeMain", required: false) -
-
- - @RenderBody() + + + + +
+ @if (User.Identity is not null && User.Identity.IsAuthenticated) + { + -
-
+ } + +
+ @await RenderSectionAsync("BeforeMain", required: false) +
+
+ + @RenderBody() +
+
+
- -
+ + - - - - @**@ - - - - -@* *@ - -@await RenderSectionAsync("scripts", required: false) - - + + + + @Html.GovUkFrontendScriptImports() diff --git a/Dfe.Academies.External.Web/Pages/_ViewImports.cshtml b/Dfe.Academies.External.Web/Pages/_ViewImports.cshtml index 55e303f3e..45b1de7b9 100644 --- a/Dfe.Academies.External.Web/Pages/_ViewImports.cshtml +++ b/Dfe.Academies.External.Web/Pages/_ViewImports.cshtml @@ -3,4 +3,4 @@ @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, GovUk.Frontend.AspNetCore @addTagHelper *, Dfe.Academies.External.Web -@addTagHelper *, NetEscapades.AspNetCore.SecurityHeaders.TagHelpers \ No newline at end of file +@addTagHelper *, NetEscapades.AspNetCore.SecurityHeaders.TagHelpers diff --git a/Dfe.Academies.External.Web/Program.cs b/Dfe.Academies.External.Web/Program.cs index 5ad8c8601..20b5bc37d 100644 --- a/Dfe.Academies.External.Web/Program.cs +++ b/Dfe.Academies.External.Web/Program.cs @@ -18,7 +18,6 @@ using Microsoft.AspNetCore.Mvc.ApplicationModels; using Microsoft.AspNetCore.HttpOverrides; using Microsoft.Extensions.Options; -using NetEscapades.AspNetCore.SecurityHeaders; using Notify.Client; using Notify.Interfaces; using Polly; @@ -26,6 +25,7 @@ using Quartz; using Serilog; using StackExchange.Redis; +using NetEscapades.AspNetCore.SecurityHeaders; namespace Dfe.Academies.External.Web {