Add stuff

This commit is contained in:
Henri Burau
2024-06-06 21:30:29 +02:00
parent 72dce76e2b
commit ddbfc32fb1
13 changed files with 77 additions and 20 deletions

View File

@ -12,6 +12,7 @@ import "bytes"
import "gitea.henriburau.de/haw-lan/cod4watcher/views"
import "strings"
import "fmt"
func Nagivation() templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
@ -46,20 +47,20 @@ func Nagivation() templ.Component {
return templ_7745c5c3_Err
}
if views.Username(ctx) != "" {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a href=\"/logout\" class=\"text-gray-300 hover:bg-gray-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<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\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(strings.ToUpper(views.Username(ctx)))
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%c", strings.ToUpper(views.Username(ctx))[0]))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views/components/navbar.templ`, Line: 31, Col: 160}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views/components/navbar.templ`, Line: 33, Col: 111}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</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>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}