package pages import ( "strconv" "git.grosinger.net/tgrosinger/saasitone/templ/components" "git.grosinger.net/tgrosinger/saasitone/pkg/form" "git.grosinger.net/tgrosinger/saasitone/pkg/page" ) type TaskForm struct { Delay int `form:"delay" validate:"gte=0"` Message string `form:"message" validate:"required"` form.Submission } templ Task(p page.Page, f *TaskForm) { if p.HTMX.Request.Target != "task" { } @taskForm(p, f) } templ taskForm(p page.Page, f *TaskForm) {
@components.Messages(p)

How long to wait until the task is executed

@components.FieldErrors(f.Submission.GetFieldErrors("Delay"))

The message the task will output to the log

@components.FieldErrors(f.Submission.GetFieldErrors("Message"))
@components.CSRF(p.CSRF)
}