FossilRepo
Fix admin sidebar: use includes() not 'in' for path matching
Commit
0cf03d9c9a79cf8c24a990fcac159b2bd8214f10330078a8062991fa6b43f550
Parent
2ea5fbeb0fd1991…
1 file changed
+1
-1
+1
-1
| --- templates/includes/sidebar.html | ||
| +++ templates/includes/sidebar.html | ||
| @@ -121,11 +121,11 @@ | ||
| 121 | 121 | <span x-show="!collapsed" class="truncate">Fossil Guide</span> |
| 122 | 122 | </a> |
| 123 | 123 | |
| 124 | 124 | <!-- Admin section (collapsible) --> |
| 125 | 125 | {% if perms.organization.view_organization or user.is_staff %} |
| 126 | - <div x-data="{ adminOpen: '/settings/' in window.location.pathname || '/projects/groups/' in window.location.pathname }"> | |
| 126 | + <div x-data="{ adminOpen: window.location.pathname.includes('/settings/') || window.location.pathname.includes('/projects/groups/') }"> | |
| 127 | 127 | <button @click="collapsed ? (collapsed = false, adminOpen = true) : (adminOpen = !adminOpen)" |
| 128 | 128 | class="flex items-center justify-between w-full rounded-md px-2 py-2 text-sm font-medium {% if '/settings/' in request.path or '/projects/groups/' in request.path %}text-white{% else %}text-gray-400 hover:bg-gray-800 hover:text-white{% endif %}" |
| 129 | 129 | :title="collapsed ? 'Admin' : ''"> |
| 130 | 130 | <span class="flex items-center gap-2"> |
| 131 | 131 | <svg class="h-4 w-4 flex-shrink-0" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> |
| 132 | 132 |
| --- templates/includes/sidebar.html | |
| +++ templates/includes/sidebar.html | |
| @@ -121,11 +121,11 @@ | |
| 121 | <span x-show="!collapsed" class="truncate">Fossil Guide</span> |
| 122 | </a> |
| 123 | |
| 124 | <!-- Admin section (collapsible) --> |
| 125 | {% if perms.organization.view_organization or user.is_staff %} |
| 126 | <div x-data="{ adminOpen: '/settings/' in window.location.pathname || '/projects/groups/' in window.location.pathname }"> |
| 127 | <button @click="collapsed ? (collapsed = false, adminOpen = true) : (adminOpen = !adminOpen)" |
| 128 | class="flex items-center justify-between w-full rounded-md px-2 py-2 text-sm font-medium {% if '/settings/' in request.path or '/projects/groups/' in request.path %}text-white{% else %}text-gray-400 hover:bg-gray-800 hover:text-white{% endif %}" |
| 129 | :title="collapsed ? 'Admin' : ''"> |
| 130 | <span class="flex items-center gap-2"> |
| 131 | <svg class="h-4 w-4 flex-shrink-0" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> |
| 132 |
| --- templates/includes/sidebar.html | |
| +++ templates/includes/sidebar.html | |
| @@ -121,11 +121,11 @@ | |
| 121 | <span x-show="!collapsed" class="truncate">Fossil Guide</span> |
| 122 | </a> |
| 123 | |
| 124 | <!-- Admin section (collapsible) --> |
| 125 | {% if perms.organization.view_organization or user.is_staff %} |
| 126 | <div x-data="{ adminOpen: window.location.pathname.includes('/settings/') || window.location.pathname.includes('/projects/groups/') }"> |
| 127 | <button @click="collapsed ? (collapsed = false, adminOpen = true) : (adminOpen = !adminOpen)" |
| 128 | class="flex items-center justify-between w-full rounded-md px-2 py-2 text-sm font-medium {% if '/settings/' in request.path or '/projects/groups/' in request.path %}text-white{% else %}text-gray-400 hover:bg-gray-800 hover:text-white{% endif %}" |
| 129 | :title="collapsed ? 'Admin' : ''"> |
| 130 | <span class="flex items-center gap-2"> |
| 131 | <svg class="h-4 w-4 flex-shrink-0" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> |
| 132 |