From 925b7b7a6a6de1f40262d0fc96be7920b26b0021 Mon Sep 17 00:00:00 2001 From: GrailFinder Date: Tue, 2 Apr 2024 12:29:25 +0300 Subject: Feat: add htmx to show|hide form --- internal/handlers/elements.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 internal/handlers/elements.go (limited to 'internal/handlers') diff --git a/internal/handlers/elements.go b/internal/handlers/elements.go new file mode 100644 index 0000000..c0da7f0 --- /dev/null +++ b/internal/handlers/elements.go @@ -0,0 +1,22 @@ +package handlers + +import ( + "html/template" + "net/http" +) + +func (h *Handlers) ServeShowForm(w http.ResponseWriter, r *http.Request) { + tmpl, err := template.ParseGlob("components/*.html") + if err != nil { + panic(err) + } + tmpl.ExecuteTemplate(w, "actionform", nil) +} + +func (h *Handlers) ServeHideForm(w http.ResponseWriter, r *http.Request) { + tmpl, err := template.ParseGlob("components/*.html") + if err != nil { + panic(err) + } + tmpl.ExecuteTemplate(w, "showformbtn", nil) +} -- cgit v1.2.3