From a0b40149e36f583dc197e8bc3a3eac3b9c7d2b7e Mon Sep 17 00:00:00 2001 From: hrice9 Date: Sat, 11 Feb 2023 22:46:58 -0500 Subject: [PATCH 01/16] basic layout changes --- HVZ.Web/Pages/_Layout.cshtml | 1 + HVZ.Web/Shared/MainLayout.razor | 11 +++---- HVZ.Web/Shared/NavMenu.razor | 6 ++-- HVZ.Web/Shared/Navigation/Footer.razor | 8 +++++ HVZ.Web/Shared/Navigation/NavBar.razor | 36 ++++++++++++++++++++++ HVZ.Web/Shared/Navigation/NavBar.razor.css | 0 6 files changed, 52 insertions(+), 10 deletions(-) create mode 100644 HVZ.Web/Shared/Navigation/Footer.razor create mode 100644 HVZ.Web/Shared/Navigation/NavBar.razor create mode 100644 HVZ.Web/Shared/Navigation/NavBar.razor.css diff --git a/HVZ.Web/Pages/_Layout.cshtml b/HVZ.Web/Pages/_Layout.cshtml index 198236ff..0977c100 100644 --- a/HVZ.Web/Pages/_Layout.cshtml +++ b/HVZ.Web/Pages/_Layout.cshtml @@ -11,6 +11,7 @@ + diff --git a/HVZ.Web/Shared/MainLayout.razor b/HVZ.Web/Shared/MainLayout.razor index 84a16aa2..031b137b 100644 --- a/HVZ.Web/Shared/MainLayout.razor +++ b/HVZ.Web/Shared/MainLayout.razor @@ -3,18 +3,15 @@ HVZ.Web
-
-
- - About -
+ +
@Body
+ +
diff --git a/HVZ.Web/Shared/NavMenu.razor b/HVZ.Web/Shared/NavMenu.razor index 1b3df88c..76823d70 100644 --- a/HVZ.Web/Shared/NavMenu.razor +++ b/HVZ.Web/Shared/NavMenu.razor @@ -1,6 +1,6 @@ - From c03640f2aba24a089336ea51928cfc10f6ee0438 Mon Sep 17 00:00:00 2001 From: hrice9 Date: Thu, 16 Feb 2023 13:51:35 -0500 Subject: [PATCH 05/16] fix failing tests --- .../ImageUploadTest.razor | 4 +-- .../LoginDisplayTest.razor | 2 ++ .../ThumbnailTest.razor | 35 +++++-------------- 3 files changed, 12 insertions(+), 29 deletions(-) diff --git a/HVZ.Tests/HVZ.Web.Components.Tests/ImageUploadTest.razor b/HVZ.Tests/HVZ.Web.Components.Tests/ImageUploadTest.razor index 5e89a7c6..c758757f 100644 --- a/HVZ.Tests/HVZ.Web.Components.Tests/ImageUploadTest.razor +++ b/HVZ.Tests/HVZ.Web.Components.Tests/ImageUploadTest.razor @@ -78,7 +78,7 @@ var img = cut.Find("img"); img.MarkupMatches( - @ + @ ); var imgName = cut.Find("#img-name"); @@ -109,7 +109,7 @@ var img = cut.Find("img"); img.MarkupMatches( - @ + @ ); var imgName = cut.Find("#img-name"); diff --git a/HVZ.Tests/HVZ.Web.Components.Tests/LoginDisplayTest.razor b/HVZ.Tests/HVZ.Web.Components.Tests/LoginDisplayTest.razor index e6155ce8..8e01bb67 100644 --- a/HVZ.Tests/HVZ.Web.Components.Tests/LoginDisplayTest.razor +++ b/HVZ.Tests/HVZ.Web.Components.Tests/LoginDisplayTest.razor @@ -6,11 +6,13 @@ @code { TestAuthorizationContext? authContext; + Mock mockOrgRepo = new Mock(); [OneTimeSetUp] public void Setup() { authContext = this.AddTestAuthorization(); + Services.AddSingleton(mockOrgRepo.Object); } [Test] diff --git a/HVZ.Tests/HVZ.Web.Components.Tests/ThumbnailTest.razor b/HVZ.Tests/HVZ.Web.Components.Tests/ThumbnailTest.razor index 4e240b65..5f5cf8b5 100644 --- a/HVZ.Tests/HVZ.Web.Components.Tests/ThumbnailTest.razor +++ b/HVZ.Tests/HVZ.Web.Components.Tests/ThumbnailTest.razor @@ -58,7 +58,7 @@ var img = cut.Find("img"); img.MarkupMatches( - @ + @ ); } @@ -74,7 +74,7 @@ var img = cut.Find("img"); string expectedsrc = $"https://ui-avatars.com/api/?name=Kevin+Smith&size={(int)size}"; img.MarkupMatches( - @ + @ ); } @@ -87,7 +87,7 @@ var img = cut.Find("img"); img.MarkupMatches( - @ + @ ); } @@ -103,7 +103,7 @@ var img = cut.Find("img"); string expectedsrc = $"https://ui-avatars.com/api/?name=Test+Org&size={(int)size}"; img.MarkupMatches( - @ + @ ); } @@ -116,7 +116,7 @@ var img = cut.Find("img"); img.MarkupMatches( - @ + @ ); } @@ -132,7 +132,7 @@ var img = cut.Find("img"); string expectedsrc = $"images/users/3_thumbnail_{(int)size}.jpeg"; img.MarkupMatches( - @ + @ ); } @@ -145,7 +145,7 @@ var img = cut.Find("img"); img.MarkupMatches( - @ + @ ); } @@ -161,26 +161,7 @@ var img = cut.Find("img"); string expectedsrc = $"images/orgs/1_thumbnail_{(int)size}.jpeg"; img.MarkupMatches( - @ - ); - } - - [Test] - public void Test_AttributeSplatting() - { - var cut = Render( - @ - ); - - var imgById = cut.Find("#thumbnail"); - var imgByClass = cut.Find(".img"); - - imgById.MarkupMatches( - @ - ); - - imgByClass.MarkupMatches( - @ + @ ); } } \ No newline at end of file From 31c4335dcaf3ad599013c13a899b9d73fbb2c197 Mon Sep 17 00:00:00 2001 From: hrice9 Date: Thu, 16 Feb 2023 14:08:20 -0500 Subject: [PATCH 06/16] fix failing tests --- .../HVZ.Web.Components.Tests/LoginDisplayTest.razor | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/HVZ.Tests/HVZ.Web.Components.Tests/LoginDisplayTest.razor b/HVZ.Tests/HVZ.Web.Components.Tests/LoginDisplayTest.razor index 8e01bb67..1ed7f925 100644 --- a/HVZ.Tests/HVZ.Web.Components.Tests/LoginDisplayTest.razor +++ b/HVZ.Tests/HVZ.Web.Components.Tests/LoginDisplayTest.razor @@ -7,12 +7,17 @@ { TestAuthorizationContext? authContext; Mock mockOrgRepo = new Mock(); + Mock mockUserRepo = new Mock(); + Mock mockImageService = new Mock(); [OneTimeSetUp] public void Setup() { - authContext = this.AddTestAuthorization(); + mockUserRepo.Setup(repo => repo.GetUserById(It.IsAny())).ReturnsAsync(new User("", "", "")); Services.AddSingleton(mockOrgRepo.Object); + Services.AddSingleton(mockUserRepo.Object); + Services.AddSingleton(mockImageService.Object); + authContext = this.AddTestAuthorization(); } [Test] @@ -32,6 +37,9 @@ public void Test_LoggedInSeesLogOutButton() { authContext?.SetAuthorized("TEST USER"); + authContext?.SetClaims( + new System.Security.Claims.Claim("DatabaseId", "1234") + ); var cut = Render( @ From 114b800e86f4a945d288537f4620642a250d7105 Mon Sep 17 00:00:00 2001 From: hrice9 Date: Sun, 19 Feb 2023 20:15:13 -0800 Subject: [PATCH 07/16] fix login display being visible on mobile view --- HVZ.Web/Shared/LoginDisplay.razor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HVZ.Web/Shared/LoginDisplay.razor b/HVZ.Web/Shared/LoginDisplay.razor index 7abeedf3..ee96d228 100644 --- a/HVZ.Web/Shared/LoginDisplay.razor +++ b/HVZ.Web/Shared/LoginDisplay.razor @@ -2,7 +2,7 @@ @inject NavigationManager Navigation @inject AuthenticationStateProvider AuthenticationStateProvider -
+
From 25a31c377c8ae7958725a6e02bb33039d6f84524 Mon Sep 17 00:00:00 2001 From: hrice9 Date: Sun, 19 Feb 2023 22:58:25 -0800 Subject: [PATCH 08/16] sticky nav --- HVZ.Web/Pages/Index.razor | 47 ++++++++++++++++++++++++++ HVZ.Web/Shared/MainLayout.razor | 1 + HVZ.Web/Shared/Navigation/Footer.razor | 36 ++++++++++++-------- 3 files changed, 70 insertions(+), 14 deletions(-) diff --git a/HVZ.Web/Pages/Index.razor b/HVZ.Web/Pages/Index.razor index 2eb82a51..617766d2 100644 --- a/HVZ.Web/Pages/Index.razor +++ b/HVZ.Web/Pages/Index.razor @@ -50,3 +50,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/HVZ.Web/Shared/MainLayout.razor b/HVZ.Web/Shared/MainLayout.razor index 18f008a3..e888be3b 100644 --- a/HVZ.Web/Shared/MainLayout.razor +++ b/HVZ.Web/Shared/MainLayout.razor @@ -14,5 +14,6 @@
+
diff --git a/HVZ.Web/Shared/Navigation/Footer.razor b/HVZ.Web/Shared/Navigation/Footer.razor index a37638cc..2c1f0396 100644 --- a/HVZ.Web/Shared/Navigation/Footer.razor +++ b/HVZ.Web/Shared/Navigation/Footer.razor @@ -1,17 +1,25 @@ -
- @* anything that should stick to the bottom of the screen goes here *@ +@*
+ anything that should stick to the bottom of the screen goes here + +
*@ +
+

Footer

-
-
-
-
-
PlayHVZ
-
-
- @* Enable when github is ready to be displayed to end users *@ - @* Github *@ - Terms of Service - Privacy +
+ From 2ae9e57ca6e3c01d17a31d49908fb353c60e4a38 Mon Sep 17 00:00:00 2001 From: hrice9 Date: Mon, 20 Feb 2023 21:03:23 -0800 Subject: [PATCH 09/16] upgrade to bootstrap 5.3 add theme toggling --- HVZ.Web/Pages/Account/Login.cshtml | 12 ++- HVZ.Web/Pages/Account/Register.cshtml | 7 +- HVZ.Web/Pages/Index.razor | 112 +++++++++++--------- HVZ.Web/Pages/_Layout.cshtml | 10 +- HVZ.Web/Shared/Navigation/Footer.razor | 12 +-- HVZ.Web/Shared/Navigation/NavBar.razor | 13 ++- HVZ.Web/Shared/Ui Helpers/ThemeToggle.razor | 38 +++++++ HVZ.Web/wwwroot/js/theme.js | 35 ++++++ HVZ.sln | 22 +--- 9 files changed, 170 insertions(+), 91 deletions(-) create mode 100644 HVZ.Web/Shared/Ui Helpers/ThemeToggle.razor create mode 100644 HVZ.Web/wwwroot/js/theme.js diff --git a/HVZ.Web/Pages/Account/Login.cshtml b/HVZ.Web/Pages/Account/Login.cshtml index 51727386..581e8f42 100644 --- a/HVZ.Web/Pages/Account/Login.cshtml +++ b/HVZ.Web/Pages/Account/Login.cshtml @@ -6,14 +6,15 @@ @{ } - + - + + @@ -64,7 +65,8 @@
- - + + - \ No newline at end of file + + \ No newline at end of file diff --git a/HVZ.Web/Pages/Account/Register.cshtml b/HVZ.Web/Pages/Account/Register.cshtml index f9a0e7e4..bd4f2a72 100644 --- a/HVZ.Web/Pages/Account/Register.cshtml +++ b/HVZ.Web/Pages/Account/Register.cshtml @@ -7,13 +7,15 @@ @{ } + - + + @@ -71,5 +73,8 @@ + + + \ No newline at end of file diff --git a/HVZ.Web/Pages/Index.razor b/HVZ.Web/Pages/Index.razor index 617766d2..e18e4202 100644 --- a/HVZ.Web/Pages/Index.razor +++ b/HVZ.Web/Pages/Index.razor @@ -10,8 +10,9 @@

Welcome to PlayHVZ.org

- -

PlayHVZ is a tool for managing games of Humans vs Zombies.

+ @*This lives here for now until we create a settings page*@ + +

PlayHVZ is a tool for managing games of Humans vs Zombies.

@@ -49,51 +50,62 @@ Discord integration -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ \ No newline at end of file diff --git a/HVZ.Web/Pages/_Layout.cshtml b/HVZ.Web/Pages/_Layout.cshtml index d32bff44..b44d01c3 100644 --- a/HVZ.Web/Pages/_Layout.cshtml +++ b/HVZ.Web/Pages/_Layout.cshtml @@ -3,13 +3,12 @@ @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers - + - @* *@ - + @@ -30,7 +29,8 @@ - - + + @**@ + diff --git a/HVZ.Web/Shared/Navigation/Footer.razor b/HVZ.Web/Shared/Navigation/Footer.razor index 2c1f0396..68bd3011 100644 --- a/HVZ.Web/Shared/Navigation/Footer.razor +++ b/HVZ.Web/Shared/Navigation/Footer.razor @@ -2,23 +2,23 @@ anything that should stick to the bottom of the screen goes here *@ -
-

Footer

+

Footer Sticky

-