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>
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -7,9 +7,9 @@ templ ServerAddress(host, port string) {
|
||||
<span class="block">
|
||||
{ host }:{ port }
|
||||
</span>
|
||||
<a class="block" href="#">
|
||||
<button>
|
||||
<i class="fa-regular fa-clipboard"></i>
|
||||
</a>
|
||||
</button>
|
||||
<a class="block" href={ templ.SafeURL(fmt.Sprintf("cod4://%s:%s", host, port)) }>
|
||||
<i class="block fa-solid fa-play"></i>
|
||||
</a>
|
||||
|
||||
@ -51,7 +51,7 @@ func ServerAddress(host, port string) templ.Component {
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</span> <a class=\"block\" href=\"#\"><i class=\"fa-regular fa-clipboard\"></i></a> <a class=\"block\" href=\"")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</span> <button><i class=\"fa-regular fa-clipboard\"></i></button> <a class=\"block\" href=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user