From 12f7cf21265d7d6c9d1d60e2ae63753846a58c4b Mon Sep 17 00:00:00 2001 From: Julian Hurst Date: Thu, 26 Jan 2023 22:25:50 +0100 Subject: Wrap template data to always pass the User --- templates/admin/users.html | 4 ++-- templates/createuser.html | 4 ++-- templates/imgs.html | 20 ++++++++++---------- templates/imgs_page.html | 10 +++++----- templates/login.html | 4 ++-- templates/nav_logged.html | 13 ++++++++++--- templates/user.html | 16 ++++++++-------- 7 files changed, 39 insertions(+), 32 deletions(-) (limited to 'templates') diff --git a/templates/admin/users.html b/templates/admin/users.html index 74ca976..9aedf44 100644 --- a/templates/admin/users.html +++ b/templates/admin/users.html @@ -3,9 +3,9 @@

User list

diff --git a/templates/createuser.html b/templates/createuser.html index 92a1b22..aa00ee3 100644 --- a/templates/createuser.html +++ b/templates/createuser.html @@ -1,8 +1,8 @@ {{define "title"}}Créer un compte utilisateur{{end}} {{define "content"}}

Créer un compte utilisateur

-{{if .Error}} -

{{.Error}}

+{{if .Data.Error}} +

{{.Data.Error}}

{{end}}
Pour des raisons de sécurité, le mot de passe doit avoir une longeur supérieure ou égale à 10 caractères.

diff --git a/templates/imgs.html b/templates/imgs.html index 51b489d..edbb0fd 100644 --- a/templates/imgs.html +++ b/templates/imgs.html @@ -3,23 +3,23 @@

Images

{{template "imgspage" .}} -
{{.NbFiles}} images +
{{.Data.NbFiles}} images {{end}} diff --git a/templates/imgs_page.html b/templates/imgs_page.html index 3f1ce58..3aa6bfa 100644 --- a/templates/imgs_page.html +++ b/templates/imgs_page.html @@ -1,12 +1,12 @@ {{define "imgspage"}} -{{range $i, $img := .Imgs}} - {{if eq (add $i $.Start) $.End}} - {{if ne $.UserImpersonation ""}} -
{{else}} -
{{end}} diff --git a/templates/login.html b/templates/login.html index 5e717c3..037879d 100644 --- a/templates/login.html +++ b/templates/login.html @@ -1,8 +1,8 @@ {{define "title"}}Connexion{{end}} {{define "content"}}

Connexion

-{{if .Error}} -

{{.Error}}

+{{if .Data.Error}} +

{{.Data.Error}}

{{end}}

diff --git a/templates/nav_logged.html b/templates/nav_logged.html index 06c7a21..d57df79 100644 --- a/templates/nav_logged.html +++ b/templates/nav_logged.html @@ -1,14 +1,21 @@ {{define "nav"}} diff --git a/templates/user.html b/templates/user.html index 4180407..42ebb3d 100644 --- a/templates/user.html +++ b/templates/user.html @@ -2,19 +2,19 @@ {{define "content"}}

Espace utilisateur

Documents

- {{if .Error}} -

{{.Error}}

+ {{if .Data.Error}} +

{{.Data.Error}}

{{end}} - {{if ne .UserImpersonation ""}} - + {{if ne .Data.UserImpersonation ""}} + {{else}} {{end}} - {{if ne .UserImpersonation ""}} -
+ {{if ne .Data.UserImpersonation ""}} + {{else}} {{end}} @@ -26,7 +26,7 @@ Date de modification Taille - {{range .Docs}} + {{range .Data.Docs}} @@ -48,7 +48,7 @@
- +
{{end}} -- cgit v1.2.3