diff --git a/src/PowderCoating.Web/Views/PlatformSettings/Index.cshtml b/src/PowderCoating.Web/Views/PlatformSettings/Index.cshtml index 911e785..8eab2fb 100644 --- a/src/PowderCoating.Web/Views/PlatformSettings/Index.cshtml +++ b/src/PowderCoating.Web/Views/PlatformSettings/Index.cshtml @@ -5,147 +5,241 @@ ViewData["Title"] = "Platform Settings"; ViewData["PageIcon"] = "bi-gear-wide-connected"; var groups = Model.GroupBy(s => s.GroupName ?? "General").OrderBy(g => g.Key); + + static string GroupIcon(string group) => group switch + { + "Notifications" => "bi-bell", + "Subscriptions" => "bi-credit-card", + "Quotes" => "bi-file-earmark-text", + "Data Retention" => "bi-clock-history", + _ => "bi-globe" + }; + + static string GroupDescription(string group) => group switch + { + "Notifications" => "Controls where platform event alerts (signups, bug reports, billing events) are sent.", + "Subscriptions" => "Trial and billing defaults applied to new tenant companies at registration.", + "Quotes" => "Default validity windows and token expiry for customer-facing quote links.", + "Data Retention" => "How long audit and webhook records are kept before the nightly purge removes them.", + _ => "Core platform configuration values used across features and email links." + }; + + static string InputType(string key) => key switch + { + var k when k.Contains("Email", StringComparison.OrdinalIgnoreCase) => "email", + var k when k.Contains("Url", StringComparison.OrdinalIgnoreCase) => "url", + var k when k.Contains("Days", StringComparison.OrdinalIgnoreCase) => "number", + _ => "text" + }; + + static string InputHint(string key) => key switch + { + var k when k.Contains("Email", StringComparison.OrdinalIgnoreCase) => "e.g. admin@example.com", + var k when k.Contains("Url", StringComparison.OrdinalIgnoreCase) => "e.g. https://app.yourdomain.com", + var k when k.Contains("Days", StringComparison.OrdinalIgnoreCase) => "Enter a whole number of days", + _ => "" + }; } @section Styles { } -
+| Setting | -Value | -Actions | -
|---|---|---|
|
- @(s.Label ?? s.Key)
- @if (!string.IsNullOrWhiteSpace(s.Description))
- {
- @s.Description
- }
- |
- - @if (string.IsNullOrWhiteSpace(s.Value)) - { - Not set - } - else - { - @s.Value - } - | -- - | -
@desc
+| Setting | +Current Value | +Actions | +
|---|---|---|
|
+ @(s.Label ?? s.Key)
+ @if (!string.IsNullOrWhiteSpace(s.Description))
+ {
+ @s.Description
+ }
+
+ |
+ @if (string.IsNullOrWhiteSpace(s.Value)) { Not set } else { - @s.Value + @s.Value } - + @if (s.UpdatedAt.HasValue) + { + + } + | ++ + | +
No platform settings found. Run a database migration to seed defaults.
+ @if (!Model.Any()) + { +No platform settings found. Run a database migration to seed defaults.
+