From 419b57c415836e8713d2a6cab4d28b5039e13c3b Mon Sep 17 00:00:00 2001 From: Nick Beckley Date: Thu, 18 Jun 2026 19:52:50 +0100 Subject: [PATCH] PD-013A: Dark Theme Audit Utility. --- PlotLine/Controllers/AdminController.cs | 15 + PlotLine/Controllers/HomeController.cs | 5 - PlotLine/Program.cs | 15 +- PlotLine/Views/Admin/ThemeAudit.cshtml | 585 ++++++++++++++++++++++++ PlotLine/Views/Home/Privacy.cshtml | 6 - PlotLine/appsettings.Development.json | 3 + PlotLine/appsettings.json | 3 + 7 files changed, 620 insertions(+), 12 deletions(-) create mode 100644 PlotLine/Controllers/AdminController.cs create mode 100644 PlotLine/Views/Admin/ThemeAudit.cshtml delete mode 100644 PlotLine/Views/Home/Privacy.cshtml diff --git a/PlotLine/Controllers/AdminController.cs b/PlotLine/Controllers/AdminController.cs new file mode 100644 index 0000000..372a82e --- /dev/null +++ b/PlotLine/Controllers/AdminController.cs @@ -0,0 +1,15 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + +namespace PlotLine.Controllers; + +[Authorize(Policy = "AdminOnly")] +[Route("admin")] +public sealed class AdminController : Controller +{ + [HttpGet("theme-audit")] + public IActionResult ThemeAudit() + { + return View(); + } +} diff --git a/PlotLine/Controllers/HomeController.cs b/PlotLine/Controllers/HomeController.cs index 006432a..8011f53 100644 --- a/PlotLine/Controllers/HomeController.cs +++ b/PlotLine/Controllers/HomeController.cs @@ -15,11 +15,6 @@ namespace PlotLine.Controllers return View(); } - public IActionResult Privacy() - { - return View(); - } - [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public IActionResult Error() { diff --git a/PlotLine/Program.cs b/PlotLine/Program.cs index 0c04225..bda7ea3 100644 --- a/PlotLine/Program.cs +++ b/PlotLine/Program.cs @@ -74,7 +74,20 @@ public class Program } }; }); - builder.Services.AddAuthorization(); + builder.Services.AddAuthorization(options => + { + options.AddPolicy("AdminOnly", policy => + { + policy.RequireAuthenticatedUser(); + policy.RequireAssertion(context => + { + var email = context.User.FindFirstValue(ClaimTypes.Email); + var allowedEmails = builder.Configuration.GetSection("Admin:AllowedEmails").Get() ?? []; + return !string.IsNullOrWhiteSpace(email) + && allowedEmails.Any(allowed => string.Equals(allowed, email, StringComparison.OrdinalIgnoreCase)); + }); + }); + }); builder.Services.AddSingleton(); builder.Services.AddScoped(); builder.Services.AddScoped(); diff --git a/PlotLine/Views/Admin/ThemeAudit.cshtml b/PlotLine/Views/Admin/ThemeAudit.cshtml new file mode 100644 index 0000000..ccc8a3d --- /dev/null +++ b/PlotLine/Views/Admin/ThemeAudit.cshtml @@ -0,0 +1,585 @@ +@{ + ViewData["Title"] = "Theme Audit"; +} + + + +
+
+

Admin utility

+

Dark Theme Audit

+

Hidden internal component samples for checking PlotDirector light and dark theme coverage.

+
+
+ +
+ This page is intentionally not linked from public navigation. Use it to log visual issues; avoid treating these samples as a new design system. +
+ +
+
+
+
+

Light theme

+

Component Samples

+

Representative UI elements using current Bootstrap and PlotDirector classes.

+
+
+ +
+

Typography

+ +

Scene planning

+

Page heading

+

Subheading

+

A lead paragraph for introduction copy and overview states.

+

Muted helper text for metadata, hints, and quieter descriptions.

+
+ +
+

Cards

+
+
+

Standard card

+

Project overview

+

Card body text with a short action row.

+
+ + +
+
+
+

Dashboard card

+

42%

+

Draft progress this week.

+
+
+
+

Empty state

+

No matching scenes were found for this filter.

+ +
+
+ +
+

Tables

+
+ + + + + + + + + + + + + + + + + + + + +
SceneStatusWarnings
Chapter 3, Scene 2DraftedWarning
Chapter 4, Scene 1OutlineInfo
+
+
+ +
+

Forms

+
+
+
+ + + Example validation message. +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
+
+
+
+ +
+

Buttons

+
+ + + + + + + + +
+
+ +
+

Alerts and Badges

+
Info alert sample.
+
Success alert sample.
+
Warning alert sample.
+
Danger alert sample.
+
+ Active + Review + Blocked + Status pill + Info + Warning + Error + Archived +
+
+ +
+

Navigation Components

+ +
+
+

+ +

+
+
Collapsible content using Bootstrap accordion styling.
+
+
+
+ + +
+ +
+

Modals and Overlays

+ + + +
+ +
+

Progress and Timeline

+
+
65%
+
+
+
+
Chapter 7Two scenes
+
+
+ Scene 1 +

A public reveal changes the stakes.

+
Revision
+
+
+ Scene 2 +

The character chooses a side.

+
Draft
+
+
+
+
+
+ +
+

PlotDirector-Specific Components

+
+
+ + +
+
+ +
+

Compact scene metadata

+
+ Draft + 1 warning + Reveal +
+
+
+
+ Warning +

Sample compact continuity warning card.

+
+
+ +
Thread event

A sample plot thread note.

+
+
+
+
+ +
+
+
+

Dark theme

+

Component Samples

+

The same representative elements scoped to dark theme attributes.

+
+
+ +
+

Typography

+ +

Scene planning

+

Page heading

+

Subheading

+

A lead paragraph for introduction copy and overview states.

+

Muted helper text for metadata, hints, and quieter descriptions.

+
+ +
+

Cards

+
+
+

Standard card

+

Project overview

+

Card body text with a short action row.

+
+ + +
+
+
+

Dashboard card

+

42%

+

Draft progress this week.

+
+
+
+

Empty state

+

No matching scenes were found for this filter.

+ +
+
+ +
+

Tables

+
+ + + + + + + + + + + + + + + + + + + + +
SceneStatusWarnings
Chapter 3, Scene 2DraftedWarning
Chapter 4, Scene 1OutlineInfo
+
+
+ +
+

Forms

+
+
+
+ + + Example validation message. +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
+
+
+
+ +
+

Buttons

+
+ + + + + + + + +
+
+ +
+

Alerts and Badges

+
Info alert sample.
+
Success alert sample.
+
Warning alert sample.
+
Danger alert sample.
+
+ Active + Review + Blocked + Status pill + Info + Warning + Error + Archived +
+
+ +
+

Navigation Components

+ +
+
+

+ +

+
+
Collapsible content using Bootstrap accordion styling.
+
+
+
+ + +
+ +
+

Modals and Overlays

+ + + +
+ +
+

Progress and Timeline

+
+
65%
+
+
+
+
Chapter 7Two scenes
+
+
+ Scene 1 +

A public reveal changes the stakes.

+
Revision
+
+
+ Scene 2 +

The character chooses a side.

+
Draft
+
+
+
+
+
+ +
+

PlotDirector-Specific Components

+
+
+ + +
+
+ +
+

Compact scene metadata

+
+ Draft + 1 warning + Reveal +
+
+
+
+ Warning +

Sample compact continuity warning card.

+
+
+ +
Thread event

A sample plot thread note.

+
+
+
+
+
diff --git a/PlotLine/Views/Home/Privacy.cshtml b/PlotLine/Views/Home/Privacy.cshtml deleted file mode 100644 index af4fb19..0000000 --- a/PlotLine/Views/Home/Privacy.cshtml +++ /dev/null @@ -1,6 +0,0 @@ -@{ - ViewData["Title"] = "Privacy Policy"; -} -

@ViewData["Title"]

- -

Use this page to detail your site's privacy policy.

diff --git a/PlotLine/appsettings.Development.json b/PlotLine/appsettings.Development.json index 0c208ae..bc88cf9 100644 --- a/PlotLine/appsettings.Development.json +++ b/PlotLine/appsettings.Development.json @@ -1,4 +1,7 @@ { + "Admin": { + "AllowedEmails": [] + }, "Logging": { "LogLevel": { "Default": "Information", diff --git a/PlotLine/appsettings.json b/PlotLine/appsettings.json index e485f0e..26a670c 100644 --- a/PlotLine/appsettings.json +++ b/PlotLine/appsettings.json @@ -19,6 +19,9 @@ "Storage": { "UploadsRoot": "" }, + "Admin": { + "AllowedEmails": ["nickbeckley5@gmail.com"] + }, "Logging": { "LogLevel": { "Default": "Information",