Update all the shit

This commit is contained in:
Henri Burau
2024-06-07 00:07:29 +02:00
parent ddbfc32fb1
commit 18265f59df
43 changed files with 609 additions and 182 deletions

View File

@ -3,6 +3,7 @@ package home
import "gitea.henriburau.de/haw-lan/cod4watcher/views/layouts"
import "gitea.henriburau.de/haw-lan/cod4watcher/models"
import "gitea.henriburau.de/haw-lan/cod4watcher/views/components"
import "gitea.henriburau.de/haw-lan/cod4watcher/views/capture"
import "gitea.henriburau.de/haw-lan/cod4watcher/views"
templ Index(captures []models.Capture) {
@ -14,10 +15,9 @@ templ Index(captures []models.Capture) {
}
</a>
}
<div class="flex gap-3 flex-wrap">
for _, capture := range captures {
@components.CaptureCard(capture)
for _, currentCapture := range captures {
@capture.CaptureCard(currentCapture)
}
</div>
}

View File

@ -13,6 +13,7 @@ import "bytes"
import "gitea.henriburau.de/haw-lan/cod4watcher/views/layouts"
import "gitea.henriburau.de/haw-lan/cod4watcher/models"
import "gitea.henriburau.de/haw-lan/cod4watcher/views/components"
import "gitea.henriburau.de/haw-lan/cod4watcher/views/capture"
import "gitea.henriburau.de/haw-lan/cod4watcher/views"
func Index(captures []models.Capture) templ.Component {
@ -35,7 +36,7 @@ func Index(captures []models.Capture) templ.Component {
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
if views.Username(ctx) != "" {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a href=\"/new/capture\" class=\"mb-8 block\">")
templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 1)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@ -45,7 +46,7 @@ func Index(captures []models.Capture) templ.Component {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Create new Capture")
templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 2)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@ -58,22 +59,22 @@ func Index(captures []models.Capture) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a>")
templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 3)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <div class=\"flex gap-3 flex-wrap\">")
templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 4)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, capture := range captures {
templ_7745c5c3_Err = components.CaptureCard(capture).Render(ctx, templ_7745c5c3_Buffer)
for _, currentCapture := range captures {
templ_7745c5c3_Err = capture.CaptureCard(currentCapture).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 5)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View File

@ -0,0 +1,5 @@
<a href=\"/new/capture\" class=\"mb-8 block\">
Create new Capture
</a>
<div class=\"flex gap-3 flex-wrap\">
</div>