package handlers import ( "context" "errors" "fmt" "html/template" "io/fs" "log" "net/http" "path/filepath" "strings" "git.dotya.ml/mirre-mt/pcmt/ent" moduser "git.dotya.ml/mirre-mt/pcmt/modules/user" "github.com/labstack/echo/v4" ) type tplMap map[string]*template.Template var ( // tmpl *template.Template tmpls = template.New("") templateMap tplMap tmplFS fs.FS ) func listAllTmpls() []string { files, err := filepath.Glob("templates/*.tmpl") if err != nil { panic(err) } // log.Println(files) for i, v := range files { files[i] = strings.TrimPrefix(v, "templates/") } log.Println("returning files") return files } func setFuncMap(t *template.Template) { t = t.Funcs(template.FuncMap{ "ifIE": func() template.HTML { return template.HTML("