summaryrefslogtreecommitdiff
path: root/internal/handlers/elements.go
blob: 965281ac1deaacf97b7dd845de1690ad10711048 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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 {
		abortWithError(w, err.Error())
		return
	}
	tmpl.ExecuteTemplate(w, "actionform", nil)
}

func (h *Handlers) ServeHideForm(w http.ResponseWriter, r *http.Request) {
	tmpl, err := template.ParseGlob("components/*.html")
	if err != nil {
		abortWithError(w, err.Error())
		return
	}
	tmpl.ExecuteTemplate(w, "showformbtn", nil)
}

func (h *Handlers) ShowRecommended(w http.ResponseWriter, r *http.Request) {
	tmpl, err := template.ParseGlob("components/*.html")
	if err != nil {
		abortWithError(w, err.Error())
		return
	}
	tmpl.ExecuteTemplate(w, "showformbtn", nil)
}

func (h *Handlers) HideRecommended(w http.ResponseWriter, r *http.Request) {
	tmpl, err := template.ParseGlob("components/*.html")
	if err != nil {
		abortWithError(w, err.Error())
		return
	}
	tmpl.ExecuteTemplate(w, "showformbtn", nil)
}