diff options
author | GrailFinder <wohilas@gmail.com> | 2024-04-02 12:29:25 +0300 |
---|---|---|
committer | GrailFinder <wohilas@gmail.com> | 2024-04-02 12:29:25 +0300 |
commit | 925b7b7a6a6de1f40262d0fc96be7920b26b0021 (patch) | |
tree | 100895b2c086d5764565d44de2e18453b2a85ad2 /internal/handlers | |
parent | 878b071112d7484fd9b22d70ee06afe895de9018 (diff) |
Feat: add htmx to show|hide form
Diffstat (limited to 'internal/handlers')
-rw-r--r-- | internal/handlers/elements.go | 22 |
1 files changed, 22 insertions, 0 deletions
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) +} |