refactor(templates): extract shared header from admin pages

- Replace inline nav code with @Header component in admin.templ
- Replace inline nav code with @Header component in admin_library.templ
- DRY up navigation, theme switcher, and user menu across admin pages
This commit is contained in:
2026-02-22 18:40:18 -05:00
parent 55440e0dc8
commit d28aa5af4b
2 changed files with 2 additions and 32 deletions
+1 -16
View File
@@ -11,22 +11,7 @@ templ Admin(user User) {
<link href="/static/style.css" rel="stylesheet">
</head>
<body class="theme-tokyo-night">
<nav class="border-b" style="border-color: var(--border); background-color: var(--bg-secondary)">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between items-center h-16">
<div class="flex items-center">
<h1 class="text-xl font-bold" style="color: var(--text-primary)">📚 Bookhoard</h1>
</div>
<div class="flex items-center space-x-4">
<a href="/" class="px-3 py-2 text-sm hover:opacity-80" style="color: var(--text-secondary)">Library</a>
<span style="color: var(--text-secondary)">Welcome, { user.Username }!</span>
<button onclick="logout()" class="btn-primary px-4 py-2 rounded text-sm">
Logout
</button>
</div>
</div>
</div>
</nav>
@Header(user, "/admin")
<div class="flex min-h-screen" style="background-color: var(--bg-primary)">
<aside class="w-64 border-r" style="background-color: var(--bg-secondary); border-color: var(--border)">