refactor(admin): remove separate sidebar, integrate admin nav into main sidebar
- Delete AdminSidebar component entirely - Add Administration section (Dashboard, Libraries, Users, Settings) to header sidebar, visible only for admin users - Remove Admin Panel link from user dropdown - Strip admin chrome (sidebar wrapper, back buttons) from all 5 admin page templates - Fix activeClass to handle trailing-slash routes correctly - Add isUserVisible helper for library visibility toggles - Fix processing issues page: remove dead Alpine JS, wire HTMX dismiss with proper mediaItemId, add issue ID swap targets - Add processing issue resolve/delete routes to library router - Add GetProcessingIssueStatsData context-based method - Fix users page: remove broken hx-headers auth, simplify role select - Fix settings page: remove dead adminSettings Alpine ref
This commit is contained in:
+23
-6
@@ -122,6 +122,29 @@ templ Header(user User, currentPath string) {
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<!-- Admin section (visible to admins only) -->
|
||||
if user.Role == "admin" {
|
||||
<div class="my-1.5 mx-3 border-t" style="border-color: color-mix(in srgb, var(--text-primary) 7%, transparent);"></div>
|
||||
<p class="px-3 pb-1 text-xs font-medium uppercase tracking-wide" style="color: var(--text-secondary);">Administration</p>
|
||||
<div class="space-y-0.5">
|
||||
<a href="/admin" class={ activeClass(currentPath, "/admin") }>
|
||||
@Icon("grid", "h-5 w-5 shrink-0")
|
||||
<span>Dashboard</span>
|
||||
</a>
|
||||
<a href="/admin/library" class={ activeClass(currentPath, "/admin/library") }>
|
||||
@Icon("library", "h-5 w-5 shrink-0")
|
||||
<span>Libraries</span>
|
||||
</a>
|
||||
<a href="/admin/users" class={ activeClass(currentPath, "/admin/users") }>
|
||||
@Icon("users", "h-5 w-5 shrink-0")
|
||||
<span>Users</span>
|
||||
</a>
|
||||
<a href="/admin/settings" class={ activeClass(currentPath, "/admin/settings") }>
|
||||
@Icon("gear", "h-5 w-5 shrink-0")
|
||||
<span>Settings</span>
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</aside>
|
||||
<!-- Topbar -->
|
||||
@@ -173,12 +196,6 @@ templ SidebarUserMenu(user User) {
|
||||
@Icon("user", "h-4 w-4")
|
||||
<span>Profile</span>
|
||||
</a>
|
||||
if user.Role == "admin" {
|
||||
<a href="/admin" class="flex items-center gap-3 px-3 py-1.5 rounded-lg text-sm transition-colors hover:bg-surface-hover" style="color: var(--text-secondary);">
|
||||
@Icon("settings", "h-4 w-4")
|
||||
<span>Admin Panel</span>
|
||||
</a>
|
||||
}
|
||||
<button
|
||||
type="button"
|
||||
@click="logout()"
|
||||
|
||||
Reference in New Issue
Block a user