Now worky

This commit is contained in:
Henri Burau
2024-06-04 14:49:57 +02:00
parent e2b9b8f176
commit b6555a1cc8
11 changed files with 58 additions and 6 deletions

View File

@ -1,5 +1,7 @@
package components
import "gitea.henriburau.de/haw-lan/cod4watcher/views"
templ Nagivation() {
<nav class="bg-gray-800">
<div class="mx-auto max-w-7xl">
@ -12,8 +14,13 @@ templ Nagivation() {
<div class="hidden sm:ml-6 sm:block">
<div class="flex space-x-4">
<!-- Current: "bg-gray-900 text-white", Default: "text-gray-300 hover:bg-gray-700 hover:text-white" -->
<a href="/" class="bg-gray-900 text-white rounded-md px-3 py-2 text-sm font-medium" aria-current="page">Dashboard</a>
<a href="/about" class="text-gray-300 hover:bg-gray-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">About</a>
if ctx.Value(views.PathContext) == "" || ctx.Value(views.PathContext) == "/" {
<a href="/" class="bg-gray-900 text-white rounded-md px-3 py-2 text-sm font-medium" aria-current="page">Dashboard</a>
<a href="/about" class="text-gray-300 hover:bg-gray-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">About</a>
} else {
<a href="/" class="text-gray-300 hover:bg-gray-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">Dashboard</a>
<a href="/about" class="text-gray-300 hover:bg-gray-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">About</a>
}
</div>
</div>
</div>