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
+4
View File
@@ -1,3 +1,7 @@
---
apply: always
---
# Development Guidelines # Development Guidelines
## Styling ## Styling
@@ -10,6 +10,7 @@ import (
"git.gorlug.de/code/ersteller/schema/ent" "git.gorlug.de/code/ersteller/schema/ent"
"git.gorlug.de/code/ersteller/schema/ent/generalqueue" "git.gorlug.de/code/ersteller/schema/ent/generalqueue"
"git.gorlug.de/code/ersteller/workflow" "git.gorlug.de/code/ersteller/workflow"
hx "maragu.dev/gomponents-htmx"
. "maragu.dev/gomponents" . "maragu.dev/gomponents"
. "maragu.dev/gomponents/html" . "maragu.dev/gomponents/html"
@@ -103,10 +104,9 @@ func (p *Page) View(c HtmxContext) {
func (p *Page) triggerForm(c HtmxContext) Node { func (p *Page) triggerForm(c HtmxContext) Node {
lang := c.GetLanguage() lang := c.GetLanguage()
return Form(Action(p.TriggerRoute.ToUrlFromContext(c, lang)), Method("post"), return Form(p.TriggerRoute.GetHtmx(lang),
Attr("hx-post", p.TriggerRoute.ToUrlFromContext(c, lang)), hx.Target("#executions-list"),
Attr("hx-target", "#executions-list"), hx.Swap("outerHTML"),
Attr("hx-swap", "outerHTML"),
Div(Class("form-row"), Div(Class("form-row"),
Input(Type("text"), Name("input"), Placeholder(texts.TriggerPlaceholder.FromLang(lang))), Input(Type("text"), Name("input"), Placeholder(texts.TriggerPlaceholder.FromLang(lang))),
Button(Type("submit"), Text(texts.TriggerButton.FromLang(lang))), Button(Type("submit"), Text(texts.TriggerButton.FromLang(lang))),