From 5eed8fa506bbd24469ec4d42a183928be89a325b Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 1 Dec 2022 23:05:59 +0100 Subject: Make repo into a Nix flake --- admin.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'admin.go') diff --git a/admin.go b/admin.go index a2c70c5..16c3b85 100644 --- a/admin.go +++ b/admin.go @@ -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 { -- cgit v1.2.3