From 6123b5825d8961f0c2c3733390fd8290233f7d55 Mon Sep 17 00:00:00 2001 From: "niklastasler@gmail.com" Date: Thu, 28 Dec 2023 21:57:18 +0100 Subject: [PATCH] feat: add form validation to addround form --- templates/components/edit_game_form.templ | 2 +- templates/components/edit_game_form_templ.go | 2 +- templates/components/rounds_list.templ | 4 ++-- templates/components/rounds_list_templ.go | 20 ++++++++++---------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/templates/components/edit_game_form.templ b/templates/components/edit_game_form.templ index d538bea..0ac474a 100644 --- a/templates/components/edit_game_form.templ +++ b/templates/components/edit_game_form.templ @@ -49,7 +49,7 @@ templ EditGameForm(g skat.Game) { diff --git a/templates/components/edit_game_form_templ.go b/templates/components/edit_game_form_templ.go index 1bb8274..c775119 100644 --- a/templates/components/edit_game_form_templ.go +++ b/templates/components/edit_game_form_templ.go @@ -169,7 +169,7 @@ func EditGameForm(g skat.Game) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"closest body\" hx-swap=\"outerHTML\" class=\"btn\">") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"#content\" class=\"btn\">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/templates/components/rounds_list.templ b/templates/components/rounds_list.templ index e26f364..7755896 100644 --- a/templates/components/rounds_list.templ +++ b/templates/components/rounds_list.templ @@ -80,7 +80,7 @@ templ AddRoundForm(game skat.Game) {

Round { fmt.Sprintf("%v", len(game.Rounds) + 1 ) }

-
+
for _, player := range game.Players {
- +
diff --git a/templates/components/rounds_list_templ.go b/templates/components/rounds_list_templ.go index 4384771..8dc84e4 100644 --- a/templates/components/rounds_list_templ.go +++ b/templates/components/rounds_list_templ.go @@ -229,7 +229,15 @@ func AddRoundForm(game skat.Game) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -310,15 +318,7 @@ func AddRoundForm(game skat.Game) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("