FossilRepo

Fix admin sidebar: use includes() not 'in' for path matching

lmata 2026-04-07 15:43 trunk
Commit 0cf03d9c9a79cf8c24a990fcac159b2bd8214f10330078a8062991fa6b43f550
--- templates/includes/sidebar.html
+++ templates/includes/sidebar.html
@@ -121,11 +121,11 @@
121121
<span x-show="!collapsed" class="truncate">Fossil Guide</span>
122122
</a>
123123
124124
<!-- Admin section (collapsible) -->
125125
{% 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/') }">
127127
<button @click="collapsed ? (collapsed = false, adminOpen = true) : (adminOpen = !adminOpen)"
128128
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 %}"
129129
:title="collapsed ? 'Admin' : ''">
130130
<span class="flex items-center gap-2">
131131
<svg class="h-4 w-4 flex-shrink-0" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
132132
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button