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

@ -25,7 +25,7 @@ templ Capture(capture *models.Capture, table models.ResultTable) {
</div>
<div class="flex w-full justify-around items-center gap-5">
if len(table.Rows) >= 1 {
@Medal("1. Platz", table.Rows[0].Name, "text-yellow-600")
@Medal("1. Platz", table.Rows[0].Name, "text-yellow-400")
}
if len(table.Rows) >= 2 {
@Medal("2. Platz", table.Rows[1].Name, "text-gray-500")

View File

@ -74,7 +74,7 @@ func Capture(capture *models.Capture, table models.ResultTable) templ.Component
return templ_7745c5c3_Err
}
if len(table.Rows) >= 1 {
templ_7745c5c3_Err = Medal("1. Platz", table.Rows[0].Name, "text-yellow-600").Render(ctx, templ_7745c5c3_Buffer)
templ_7745c5c3_Err = Medal("1. Platz", table.Rows[0].Name, "text-yellow-400").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View File

@ -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>
}

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
}

View File

@ -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>

View File

@ -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
}