From 70e62263d3b7298bcd6bf52dc1087cb7709321f4 Mon Sep 17 00:00:00 2001 From: dingo Date: Thu, 23 Apr 2026 08:50:14 -0400 Subject: [PATCH] feat(website): routing fixes, login by username, leaderboard stats, news CMS, CDN art MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Website fixes: - /how-to-play and /ai-assets and /ai-assets/report: add explicit @page routes (default Razor Pages routes were PascalCase, nav links used kebab-case) - Webclient: redirect to webclient.aeternalisgames.com instead of /webclient/app - Login: accept display name (username) or email; looks up by email first, then by DisplayName — uses TUser overload of PasswordSignInAsync with lockout support Leaderboard: - Add GamesPlayed, GamesWon, WinRate columns - Inject GameDbContext; query completed sessions for the top-N account IDs and aggregate wins/plays in memory (cross-schema, no EF join) News CMS: - NewsPost entity in catalog schema (slug, title, summary, bodyHtml, heroImageUrl, author, published state, timestamps) - CatalogDbContext: add DbSet + model config - Migration: 20260423000001_AddNewsPosts - Website Program.cs: register AddGameDatabase - News/Index.cshtml: list published posts with hero image + summary - News/Post.cshtml: individual post detail page at /news/{slug} - Admin NewsPostList.razor: list all posts, delete with confirm modal - Admin NewsPostEditor.razor: full CRUD editor — title, slug (auto from title), summary, HTML body with live preview toggle, hero image with preview, publish toggle + date/time, author - Admin NavMenu: add Website section with News Posts link CDN art: - Index.cshtml.cs: inject IConfiguration, expose CdnBaseUrl - Index.cshtml: add hero-bg-img sourced from {cdnBase}/website/hero-bg.jpg (upload hero-bg.jpg to CDN /website/ to activate; no image = no broken element) Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- .../SOR.Admin/Components/Layout/NavMenu.razor | 12 + .../Pages/Website/NewsPostEditor.razor | 289 ++++++++++++++++++ .../Pages/Website/NewsPostList.razor | 121 ++++++++ .../SOR.Database/Contexts/CatalogDbContext.cs | 12 + .../SOR.Database/Entities/Catalog/NewsPost.cs | 39 +++ .../Catalog/20260423000001_AddNewsPosts.cs | 58 ++++ .../SOR.Website/Pages/AiAssets/Index.cshtml | 2 +- .../SOR.Website/Pages/AiAssets/Report.cshtml | 2 +- .../src/SOR.Website/Pages/Auth/Login.cshtml | 12 +- .../SOR.Website/Pages/Auth/Login.cshtml.cs | 55 ++-- Server/src/SOR.Website/Pages/HowToPlay.cshtml | 2 +- Server/src/SOR.Website/Pages/Index.cshtml | 9 + Server/src/SOR.Website/Pages/Index.cshtml.cs | 14 +- .../src/SOR.Website/Pages/Leaderboard.cshtml | 8 +- .../SOR.Website/Pages/Leaderboard.cshtml.cs | 90 +++++- .../src/SOR.Website/Pages/News/Index.cshtml | 47 ++- .../SOR.Website/Pages/News/Index.cshtml.cs | 16 +- Server/src/SOR.Website/Pages/News/Post.cshtml | 62 ++++ .../src/SOR.Website/Pages/News/Post.cshtml.cs | 28 ++ .../src/SOR.Website/Pages/Webclient.cshtml.cs | 5 +- Server/src/SOR.Website/Program.cs | 1 + 21 files changed, 822 insertions(+), 62 deletions(-) create mode 100644 Server/src/SOR.Admin/Components/Pages/Website/NewsPostEditor.razor create mode 100644 Server/src/SOR.Admin/Components/Pages/Website/NewsPostList.razor create mode 100644 Server/src/SOR.Database/Entities/Catalog/NewsPost.cs create mode 100644 Server/src/SOR.Database/Migrations/Catalog/20260423000001_AddNewsPosts.cs create mode 100644 Server/src/SOR.Website/Pages/News/Post.cshtml create mode 100644 Server/src/SOR.Website/Pages/News/Post.cshtml.cs diff --git a/Server/src/SOR.Admin/Components/Layout/NavMenu.razor b/Server/src/SOR.Admin/Components/Layout/NavMenu.razor index 4682e41..159adbb 100644 --- a/Server/src/SOR.Admin/Components/Layout/NavMenu.razor +++ b/Server/src/SOR.Admin/Components/Layout/NavMenu.razor @@ -195,6 +195,18 @@ +