feat(ui): refresh auth, entry, admin, and secondary pages
Apply the new design-system primitives across the remaining pages so the whole app shares one visual language: - Auth/entry: redesigned index, login, register (centered card layout, SVG icons, semantic tokens) - Admin: sidebar nav with icons, cohesive admin dashboard/users/library/ processing-issues/settings (tables use border-line + hover states; scan/websocket attributes preserved) - Secondary: analytics (stat cards), devices, progress, conflicts, queue, profile + form/modal all migrated to .card/.btn/.input primitives and SVG action icons - Docs + API explorer + setup wizard + collection/rules/modals + unlinked books + book-detail modals: consistent chrome, modal scrims use --surface-overlay, close buttons use icon-btn - reader.templ and error.templ intentionally left unchanged
This commit is contained in:
+41
-47
@@ -6,60 +6,54 @@ templ Login(sessionExpired bool, deleted bool) {
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title>Login</title>
|
||||
<title>Login - Bookhoard</title>
|
||||
<script src="/static/htmx.min.js"></script>
|
||||
<script type="module" src="/static/main.js"></script>
|
||||
<link href="/static/style.css" rel="stylesheet"/>
|
||||
</head>
|
||||
<body class="theme-tokyo-night min-h-screen" x-data="login" x-init="initLoginTheme()">
|
||||
<div class="container mx-auto px-4 py-8 max-w-md">
|
||||
<div class="flex justify-between items-center mb-8">
|
||||
<h1 class="text-3xl font-bold">Login to Bookhoard</h1>
|
||||
<select id="theme-select" @change="changeTheme()" class="px-3 py-2 border rounded" style="background-color: var(--bg-secondary); color: var(--text-primary); border-color: var(--border)">
|
||||
<option value="tokyo-night">Tokyo Night</option>
|
||||
<option value="dracula">Dracula</option>
|
||||
<option value="nord">Nord</option>
|
||||
<option value="solarized-dark">Solarized Dark</option>
|
||||
<option value="monokai">Monokai</option>
|
||||
<option value="one-dark-pro">One Dark Pro</option>
|
||||
<option value="material-dark">Material Dark</option>
|
||||
<option value="catppuccin-mocha">Catppuccin Mocha</option>
|
||||
<option value="catppuccin-macchiato">Catppuccin Macchiato</option>
|
||||
<option value="catppuccin-frappe">Catppuccin Frappé</option>
|
||||
<option value="catppuccin-latte">Catppuccin Latte</option>
|
||||
<body class="theme-tokyo-night flex min-h-screen items-center justify-center px-4" x-data="login" x-init="initLoginTheme()">
|
||||
<div class="w-full max-w-md">
|
||||
<div class="mb-8 flex items-center justify-center gap-2 text-2xl font-bold tracking-tight text-content">
|
||||
@Icon("book-open", "h-7 w-7 text-brand")
|
||||
Bookhoard
|
||||
</div>
|
||||
<div class="mb-6 flex justify-end">
|
||||
<select id="theme-select" @change="changeTheme()" class="input w-auto py-1.5 text-xs">
|
||||
for _, t := range ThemeOptions {
|
||||
<option value={ t.Name }>{ t.Label }</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
if sessionExpired {
|
||||
<div class="mb-4 p-3 rounded-lg border" style="background-color: var(--bg-secondary); border-color: var(--accent);">
|
||||
<p style="color: var(--text-primary);">
|
||||
Your session has expired. Please log in again to continue.
|
||||
</p>
|
||||
<div class="card p-6">
|
||||
<h1 class="mb-5 text-xl font-bold text-content">Welcome back</h1>
|
||||
if sessionExpired {
|
||||
<div class="mb-4 flex items-start gap-2 rounded-lg border border-brand/40 bg-brand/10 p-3 text-sm text-content">
|
||||
@Icon("info", "h-4 w-4 mt-0.5 shrink-0 text-brand")
|
||||
<span>Your session has expired. Please log in again to continue.</span>
|
||||
</div>
|
||||
}
|
||||
if deleted {
|
||||
<div class="mb-4 flex items-start gap-2 rounded-lg border border-success/40 bg-success/10 p-3 text-sm text-content">
|
||||
@Icon("check-circle", "h-4 w-4 mt-0.5 shrink-0 text-success")
|
||||
<span>Your account has been deleted successfully.</span>
|
||||
</div>
|
||||
}
|
||||
<form hx-post="/api/auth/login" hx-target="#result" hx-swap="innerHTML" class="space-y-4">
|
||||
<div>
|
||||
<label class="mb-1.5 block text-xs font-semibold uppercase tracking-wide text-content-muted">Email or Username</label>
|
||||
<input type="text" name="login" class="input" required/>
|
||||
</div>
|
||||
<div>
|
||||
<label class="mb-1.5 block text-xs font-semibold uppercase tracking-wide text-content-muted">Password</label>
|
||||
<input type="password" name="password" class="input" required/>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary w-full">Sign In</button>
|
||||
</form>
|
||||
<div id="result" class="mt-4 text-center text-sm"></div>
|
||||
<div class="mt-4 border-t border-line pt-4 text-center">
|
||||
<a href="/register" class="text-sm text-content-muted transition-colors hover:text-content">Don't have an account? Sign Up</a>
|
||||
</div>
|
||||
}
|
||||
if deleted {
|
||||
<div class="mb-4 p-3 rounded-lg border" style="background-color: var(--bg-secondary); border-color: var(--accent);">
|
||||
<p style="color: var(--text-primary);">
|
||||
Your account has been deleted successfully.
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
<form hx-post="/api/auth/login" hx-target="#result" hx-swap="innerHTML" class="card p-6 rounded-lg shadow-md border">
|
||||
<div class="mb-4">
|
||||
<label class="block mb-2" style="color: var(--text-secondary)">Email or Username</label>
|
||||
<input type="text" name="login" class="w-full px-3 py-2 border rounded" style="background-color: var(--bg-primary); color: var(--text-primary); border-color: var(--border)" required/>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<label class="block mb-2" style="color: var(--text-secondary)">Password</label>
|
||||
<input type="password" name="password" class="w-full px-3 py-2 border rounded" style="background-color: var(--bg-primary); color: var(--text-primary); border-color: var(--border)" required/>
|
||||
</div>
|
||||
<button type="submit" class="btn-primary w-full py-2 rounded">
|
||||
Sign In
|
||||
</button>
|
||||
</form>
|
||||
<div id="result" class="mt-4 text-center"></div>
|
||||
<p class="text-center mt-4">
|
||||
<a href="/register" class="text-blue-500 hover:underline">Don't have an account? Sign Up</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user