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:
+10
-1
@@ -16,7 +16,7 @@ import (
|
||||
|
||||
func activeClass(current, target string) string {
|
||||
base := "flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors "
|
||||
if current == target {
|
||||
if strings.TrimRight(current, "/") == strings.TrimRight(target, "/") {
|
||||
return base + "bg-brand/15 text-brand"
|
||||
}
|
||||
return base + "text-content-muted hover:bg-surface-hover hover:text-content"
|
||||
@@ -40,6 +40,15 @@ func ContainsString(slice []string, item string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func isUserVisible(userID string, visibility []UserVisibilityData) bool {
|
||||
for _, v := range visibility {
|
||||
if v.UserID == userID {
|
||||
return v.IsVisible
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// TotalMediaCount sums the MediaCount across the given libraries,
|
||||
// used to display the total next to the "All Libraries" option.
|
||||
func TotalMediaCount(libs []LibraryData) int64 {
|
||||
|
||||
Reference in New Issue
Block a user