Skip to content

Commit

Permalink
feat: add form validation to addround form
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarow committed Dec 28, 2023
1 parent e84143f commit 6123b58
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion templates/components/edit_game_form.templ
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ templ EditGameForm(g skat.Game) {
</div>
</div>
<div class="modal-action">
<button hx-put={ fmt.Sprintf("/games/%v/edit", g.ID) } hx-target="closest body" hx-swap="outerHTML" class="btn">Submit</button>
<button hx-put={ fmt.Sprintf("/games/%v/edit", g.ID) } hx-target="#content" class="btn">Submit</button>
<button class="btn">Cancel</button>
</div>
</form>
Expand Down
2 changes: 1 addition & 1 deletion templates/components/edit_game_form_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions templates/components/rounds_list.templ
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ templ AddRoundForm(game skat.Game) {
<div class="card bg-base-200 shadow-xl">
<div class="card-body">
<h2 class="card-title">Round { fmt.Sprintf("%v", len(game.Rounds) + 1 ) }</h2>
<form>
<form hx-post={ fmt.Sprintf("/games/%v/rounds", game.ID) } hx-target="closest body">
<div class="flex flex-row flex-wrap gap-2 pb-4">
for _, player := range game.Players {
<label class="form-control">
Expand Down Expand Up @@ -111,7 +111,7 @@ templ AddRoundForm(game skat.Game) {
</div>
</div>
<div class="card-actions justify-end">
<button hx-post={ fmt.Sprintf("/games/%v/rounds", game.ID) } hx-target="closest body" class="btn btn-primary">Submit</button>
<button class="btn btn-primary">Submit</button>
</div>
</form>
</div>
Expand Down
20 changes: 10 additions & 10 deletions templates/components/rounds_list_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6123b58

Please sign in to comment.