Use hx library

This commit is contained in:
Achim Rohn
2026-04-05 11:47:11 +02:00
parent 5bab8de040
commit e6069a3b64
2 changed files with 8 additions and 4 deletions
@@ -10,6 +10,7 @@ import (
"git.gorlug.de/code/ersteller/schema/ent"
"git.gorlug.de/code/ersteller/schema/ent/generalqueue"
"git.gorlug.de/code/ersteller/workflow"
hx "maragu.dev/gomponents-htmx"
. "maragu.dev/gomponents"
. "maragu.dev/gomponents/html"
@@ -103,10 +104,9 @@ func (p *Page) View(c HtmxContext) {
func (p *Page) triggerForm(c HtmxContext) Node {
lang := c.GetLanguage()
return Form(Action(p.TriggerRoute.ToUrlFromContext(c, lang)), Method("post"),
Attr("hx-post", p.TriggerRoute.ToUrlFromContext(c, lang)),
Attr("hx-target", "#executions-list"),
Attr("hx-swap", "outerHTML"),
return Form(p.TriggerRoute.GetHtmx(lang),
hx.Target("#executions-list"),
hx.Swap("outerHTML"),
Div(Class("form-row"),
Input(Type("text"), Name("input"), Placeholder(texts.TriggerPlaceholder.FromLang(lang))),
Button(Type("submit"), Text(texts.TriggerButton.FromLang(lang))),