The pages built so far now live inside the shell of the mockups instead of the M0 placeholder, every interface text comes from Resources/it-IT, and each user keeps their own look and start page. - Shell: top bar, collapsible side menu with fly-out sub-menus, status bar and tabs that keep each page alive (page type and route values per tab, so a tab never shows another page); at most 12 tabs, least-used clean tab evicted. - One shortcut table with Alt variants for the combinations browsers keep (Ctrl+W, Ctrl+Tab, Ctrl+N); command palette for pages and commands. - ITexts over embedded JSON; tests forbid literal texts in .razor components and check that every key used exists. - User settings in sys_user_settings / user_settings; theme written on the server; profile page with live preview, start page, sessions and shortcuts. - Home, coming-soon pages for later milestones, localized sign-in and error pages; ADR 0020; wiki, CHANGELOG, STATUS and data model updated. Refs #25 #26 #31 #33 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
54 lines
2.3 KiB
Plaintext
54 lines
2.3 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="it" @attributes="RootAttributes">
|
|
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<meta name="theme-color" content="#17243A" />
|
|
<base href="/" />
|
|
<link rel="icon" href="favicon.ico" sizes="any" />
|
|
<link rel="icon" href="icon.svg" type="image/svg+xml" />
|
|
<link rel="apple-touch-icon" href="icon-256.png" />
|
|
<ResourcePreloader />
|
|
<link rel="stylesheet" href="@Assets["css/tokens.css"]" />
|
|
<link rel="stylesheet" href="@Assets["css/components.css"]" />
|
|
<link rel="stylesheet" href="@Assets["css/interactive.css"]" />
|
|
<link rel="stylesheet" href="@Assets["css/print.css"]" />
|
|
<link rel="stylesheet" href="@Assets["app.css"]" />
|
|
<link rel="stylesheet" href="@Assets["Khaemhat.Web.styles.css"]" />
|
|
@* No <ImportMap />: it is an inline script, and the content security policy allows none (no JS modules yet). *@
|
|
<HeadOutlet @rendermode="PageRenderMode" />
|
|
</head>
|
|
|
|
<body>
|
|
<Routes @rendermode="PageRenderMode" />
|
|
<ReconnectModal />
|
|
<script src="@Assets["_framework/blazor.web.js"]"></script>
|
|
<script src="@Assets["js/khaemhat.js"]"></script>
|
|
</body>
|
|
|
|
</html>
|
|
|
|
@code {
|
|
[CascadingParameter]
|
|
private HttpContext HttpContext { get; set; } = default!;
|
|
|
|
private IReadOnlyDictionary<string, object> RootAttributes { get; set; } = new Dictionary<string, object>();
|
|
|
|
// The sign-in pages are static server-rendered forms (they set the cookie); everything else is interactive.
|
|
private IComponentRenderMode? PageRenderMode => HttpContext.AcceptsInteractiveRouting() ? InteractiveServer : null;
|
|
|
|
[Inject]
|
|
private UserSettingsService Settings { get; set; } = default!;
|
|
|
|
/// <inheritdoc />
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
// The theme of the signed-in user is written on the server, so the first paint already has the right colours;
|
|
// before sign-in the system theme applies (data-theme="auto").
|
|
var actor = SessionCookie.ActorOf(HttpContext.User);
|
|
var preferences = actor is null ? null : await Settings.GetPreferencesAsync(actor, HttpContext.RequestAborted);
|
|
RootAttributes = ThemeService.RootAttributes(preferences).ToDictionary(a => a.Key, a => (object)a.Value);
|
|
}
|
|
}
|