diff options
author | Alex Auvolat <alex@adnab.me> | 2022-12-01 23:05:59 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-12-01 23:25:26 +0100 |
commit | 5eed8fa506bbd24469ec4d42a183928be89a325b (patch) | |
tree | 3ed0e5f514ec1c628bd6c0bbe634d12f5cb8ada4 /admin.go | |
parent | 3c846b6a59c1e725b56b7784c30cfbd5a3dc080b (diff) | |
download | guichet-5eed8fa506bbd24469ec4d42a183928be89a325b.tar.gz guichet-5eed8fa506bbd24469ec4d42a183928be89a325b.zip |
Make repo into a Nix flake
Diffstat (limited to 'admin.go')
-rw-r--r-- | admin.go | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -2,7 +2,6 @@ package main import ( "fmt" - "html/template" "net/http" "regexp" "sort" @@ -48,7 +47,7 @@ type AdminUsersTplData struct { } func handleAdminUsers(w http.ResponseWriter, r *http.Request) { - templateAdminUsers := template.Must(template.ParseFiles("templates/layout.html", "templates/admin_users.html")) + templateAdminUsers := getTemplate("admin_users.html") login := checkAdminLogin(w, r) if login == nil { @@ -87,7 +86,7 @@ type AdminGroupsTplData struct { } func handleAdminGroups(w http.ResponseWriter, r *http.Request) { - templateAdminGroups := template.Must(template.ParseFiles("templates/layout.html", "templates/admin_groups.html")) + templateAdminGroups := getTemplate("admin_groups.html") login := checkAdminLogin(w, r) if login == nil { @@ -165,7 +164,7 @@ type PropValues struct { } func handleAdminLDAP(w http.ResponseWriter, r *http.Request) { - templateAdminLDAP := template.Must(template.ParseFiles("templates/layout.html", "templates/admin_ldap.html")) + templateAdminLDAP := getTemplate("admin_ldap.html") login := checkAdminLogin(w, r) if login == nil { @@ -551,7 +550,7 @@ type CreateData struct { } func handleAdminCreate(w http.ResponseWriter, r *http.Request) { - templateAdminCreate := template.Must(template.ParseFiles("templates/layout.html", "templates/admin_create.html")) + templateAdminCreate := getTemplate("admin_create.html") login := checkAdminLogin(w, r) if login == nil { |