refactor(templates): apply activeClass helper and full-width layout

- Replace inline ternary operators with activeClass helper function
- Change layout containers from max-w-7xl to w-full for full-width design
- Update file path references in error messages for better debugging
This commit is contained in:
2026-02-24 13:41:19 -05:00
parent 3128ae05a6
commit 4b43116f13
19 changed files with 219 additions and 195 deletions
+4 -13
View File
@@ -5,25 +5,16 @@ templ AdminSidebar(user User, currentPath string) {
<div class="p-6">
<h2 class="text-lg font-semibold mb-6" style="color: var(--text-primary)">Admin Panel</h2>
<nav class="space-y-2">
<a href="/admin"
class={"block px-4 py-2 rounded-lg " +
("bg-accent text-bg-primary" if currentPath == "/admin" else "hover:opacity-80")}
style="color: var(--text-primary)">
<a href="/admin" class={activeClass(currentPath, "/admin")} style="color: var(--text-primary)">
🏠 Dashboard
</a>
<a href="/admin/users"
class={"block px-4 py-2 rounded-lg " +
("bg-accent text-bg-primary" if currentPath == "/admin/users" else "hover:opacity-80")}
style="color: var(--text-primary)">
<a href="/admin/users" class={activeClass(currentPath, "/admin/users")} style="color: var(--text-primary)">
👤 User Administration
</a>
<a href="/admin/library"
class={"block px-4 py-2 rounded-lg " +
("bg-accent text-bg-primary" if currentPath == "/admin/library" else "hover:opacity-80")}
style="color: var(--text-primary)">
<a href="/admin/library" class={activeClass(currentPath, "/admin/library")} style="color: var(--text-primary)">
📚 Library Management
</a>
</nav>
</div>
</aside>
}
}