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 @@
- @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)
+
+
+
+
-
-
+
+
-
-
-
- @**@
-
-
-
-
-@* *@
-
-@await RenderSectionAsync("scripts", required: false)
-
-
+
+
+
+ @Html.GovUkFrontendScriptImports()