Add stuff
This commit is contained in:
@ -2,6 +2,7 @@ package components
|
||||
|
||||
import "gitea.henriburau.de/haw-lan/cod4watcher/views"
|
||||
import "strings"
|
||||
import "fmt"
|
||||
|
||||
templ Nagivation() {
|
||||
<nav class="bg-gray-800">
|
||||
@ -28,7 +29,10 @@ templ Nagivation() {
|
||||
</div>
|
||||
<div class="absolute inset-y-0 right-0 flex items-center pr-2 sm:static sm:inset-auto sm:ml-6 sm:pr-0">
|
||||
if views.Username(ctx) != "" {
|
||||
<a href="/logout" class="text-gray-300 hover:bg-gray-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">{ strings.ToUpper(views.Username(ctx)) }</a>
|
||||
<div class="bg-gray-300 rounded-full mx-3 w-6 h-6 flex items-center justify-center">
|
||||
<span class="block text-gray-800 font-bold">{ fmt.Sprintf("%c", strings.ToUpper(views.Username(ctx))[0]) }</span>
|
||||
</div>
|
||||
<a href="/logout" class="text-gray-300 hover:bg-gray-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">Logout</a>
|
||||
} else {
|
||||
<a href="/login" class="text-gray-300 hover:bg-gray-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">Login</a>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user