FossilRepo

fossilrepo / templates / includes / nav.html
Source Blame History 60 lines
4ce269c… ragelink 1 {% load static %}
0e40dc2… ragelink 2 <nav aria-label="Main navigation" class="bg-gray-900 border-b border-gray-700">
4ce269c… ragelink 3 <div class="px-4 sm:px-6 lg:px-8">
4ce269c… ragelink 4 <div class="flex h-14 items-center justify-between">
4ce269c… ragelink 5 <div class="flex items-center gap-3">
2eca4eb… ragelink 6 <!-- Mobile sidebar toggle -->
0e40dc2… ragelink 7 <button @click="mobileSidebar = !mobileSidebar" aria-label="Toggle sidebar" class="lg:hidden rounded-md p-2 text-gray-400 hover:text-white hover:bg-gray-800">
2eca4eb… ragelink 8 <svg class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
2eca4eb… ragelink 9 <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
2eca4eb… ragelink 10 </svg>
2eca4eb… ragelink 11 </button>
4ce269c… ragelink 12 <a href="{% url 'dashboard' %}" class="flex-shrink-0">
4ce269c… ragelink 13 <img src="{% static 'img/fossilrepo-logo-dark.png' %}" alt="Fossilrepo" class="h-7 w-auto">
4ce269c… ragelink 14 </a>
4ce269c… ragelink 15 </div>
4ce269c… ragelink 16 <div class="flex items-center gap-3">
4ce269c… ragelink 17 <!-- Quick search -->
4ce269c… ragelink 18 <div x-data="{ open: false }" class="relative">
4ce269c… ragelink 19 <button @click="open = !open; $nextTick(() => $refs.searchInput?.focus())" class="rounded-md p-2 text-gray-400 hover:text-white hover:bg-gray-800" title="Search (/)">
4ce269c… ragelink 20 <svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
4ce269c… ragelink 21 <path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z" />
4ce269c… ragelink 22 </svg>
4ce269c… ragelink 23 </button>
4ce269c… ragelink 24 <div x-show="open" @click.outside="open = false" @keydown.escape.window="open = false" x-transition
4ce269c… ragelink 25 class="absolute right-0 z-20 mt-2 w-80 rounded-lg bg-gray-800 shadow-lg ring-1 ring-gray-700 p-3">
4ce269c… ragelink 26 <form method="get" action="{% if request.resolver_match.kwargs.slug %}/projects/{{ request.resolver_match.kwargs.slug }}/fossil/search/{% else %}/projects/fossil-scm/fossil/search/{% endif %}">
4ce269c… ragelink 27 <input type="text" name="q" x-ref="searchInput" placeholder="Search checkins, tickets, wiki..."
0e40dc2… ragelink 28 aria-label="Search checkins, tickets, wiki"
4ce269c… ragelink 29 class="w-full rounded-md border-gray-600 bg-gray-900 text-gray-100 text-sm px-3 py-2 focus:border-brand focus:ring-brand">
4ce269c… ragelink 30 </form>
4ce269c… ragelink 31 </div>
4ce269c… ragelink 32 </div>
4ce269c… ragelink 33 <!-- Theme toggle -->
4ce269c… ragelink 34 <button x-data="{ dark: document.documentElement.classList.contains('dark') }"
4ce269c… ragelink 35 @click="dark = !dark; document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', dark ? 'dark' : 'light')"
4ce269c… ragelink 36 class="rounded-md p-2 text-gray-400 hover:text-white hover:bg-gray-800"
4ce269c… ragelink 37 title="Toggle theme">
4ce269c… ragelink 38 <svg x-show="dark" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
4ce269c… ragelink 39 <path stroke-linecap="round" stroke-linejoin="round" d="M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z" />
4ce269c… ragelink 40 </svg>
4ce269c… ragelink 41 <svg x-show="!dark" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="display:none">
4ce269c… ragelink 42 <path stroke-linecap="round" stroke-linejoin="round" d="M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z" />
4ce269c… ragelink 43 </svg>
4ce269c… ragelink 44 </button>
4ce269c… ragelink 45 <!-- User menu -->
4ce269c… ragelink 46 <div class="relative" x-data="{ open: false }">
0e40dc2… ragelink 47 <button @click="open = !open" aria-label="User menu" class="flex items-center text-sm text-gray-400 hover:text-white">
4ce269c… ragelink 48 {{ user.get_full_name|default:user.username }}
4ce269c… ragelink 49 <svg class="ml-1 h-4 w-4" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z" clip-rule="evenodd"/></svg>
4ce269c… ragelink 50 </button>
4ce269c… ragelink 51 <div x-show="open" @click.outside="open = false" x-transition
4ce269c… ragelink 52 class="absolute right-0 z-10 mt-2 w-48 rounded-md bg-gray-800 py-1 shadow-lg ring-1 ring-gray-700">
c588255… ragelink 53 <a href="{% url 'accounts:profile' %}" class="block px-4 py-2 text-sm text-gray-300 hover:bg-gray-700 hover:text-white">Profile</a>
c588255… ragelink 54 <form method="post" action="{% url 'accounts:logout' %}">{% csrf_token %}<button type="submit" class="block w-full text-left px-4 py-2 text-sm text-gray-300 hover:bg-gray-700 hover:text-white">Sign out</button></form>
4ce269c… ragelink 55 </div>
4ce269c… ragelink 56 </div>
4ce269c… ragelink 57 </div>
4ce269c… ragelink 58 </div>
4ce269c… ragelink 59 </div>
4ce269c… ragelink 60 </nav>

Keyboard Shortcuts

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