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
61 lines
2.6 KiB
Templ
61 lines
2.6 KiB
Templ
package templates
|
|
|
|
templ Login(sessionExpired bool, deleted bool) {
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
<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 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>
|
|
<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>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|
|
}
|