diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-07-19 15:39:49 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-07-19 15:39:49 +0200 |
commit | a84ac778adf57d6446eef6577e617a80d4c6bb8e (patch) | |
tree | 5c622349b2784cbe7c3fd7fa901758c2b161b091 /admin.go | |
parent | b41630e941b44a8fffe09f42d9a7efb728fcbfa1 (diff) | |
download | guichet-a84ac778adf57d6446eef6577e617a80d4c6bb8e.tar.gz guichet-a84ac778adf57d6446eef6577e617a80d4c6bb8e.zip |
Ease packaging by making resource path configurable
Diffstat (limited to 'admin.go')
-rw-r--r-- | admin.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -48,7 +48,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 := template.Must(template.ParseFiles(config.Resources[0]+"/templates/layout.html", config.Resources[0]+"/templates/admin_users.html")) login := checkAdminLogin(w, r) if login == nil { @@ -87,7 +87,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 := template.Must(template.ParseFiles(config.Resources[0]+"/templates/layout.html", config.Resources[0]+"/templates/admin_groups.html")) login := checkAdminLogin(w, r) if login == nil { @@ -165,7 +165,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 := template.Must(template.ParseFiles(config.Resources[0]+"/templates/layout.html", config.Resources[0]+"/templates/admin_ldap.html")) login := checkAdminLogin(w, r) if login == nil { @@ -551,7 +551,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 := template.Must(template.ParseFiles(config.Resources[0]+"/templates/layout.html", config.Resources[0]+"/templates/admin_create.html")) login := checkAdminLogin(w, r) if login == nil { |