From f416775268085c7fb7f90cf54ea2149267b960e6 Mon Sep 17 00:00:00 2001 From: Julian Hurst Date: Wed, 25 Jan 2023 01:23:58 +0100 Subject: Add user impersonation support for admins --- templates/createuser.html | 2 ++ templates/imgs.html | 8 ++++++++ templates/imgs_page.html | 6 ++++++ templates/nav_logged.html | 5 +++++ templates/user.html | 12 ++++++++++++ 5 files changed, 33 insertions(+) (limited to 'templates') diff --git a/templates/createuser.html b/templates/createuser.html index ee4858b..92a1b22 100644 --- a/templates/createuser.html +++ b/templates/createuser.html @@ -10,6 +10,8 @@





+ +

{{end}} diff --git a/templates/imgs.html b/templates/imgs.html index e747034..51b489d 100644 --- a/templates/imgs.html +++ b/templates/imgs.html @@ -4,13 +4,21 @@ {{template "imgspage" .}}
{{.NbFiles}} images diff --git a/templates/imgs_page.html b/templates/imgs_page.html index 665daf3..3f1ce58 100644 --- a/templates/imgs_page.html +++ b/templates/imgs_page.html @@ -1,9 +1,15 @@ {{define "imgspage"}} {{range $i, $img := .Imgs}} {{if eq (add $i $.Start) $.End}} + {{if ne $.UserImpersonation ""}} +
+ {{else}}
+ {{end}} {{$img.Name}}

{{else}} diff --git a/templates/nav_logged.html b/templates/nav_logged.html index 50e9a36..06c7a21 100644 --- a/templates/nav_logged.html +++ b/templates/nav_logged.html @@ -2,8 +2,13 @@ diff --git a/templates/user.html b/templates/user.html index cd0d98c..9a3a333 100644 --- a/templates/user.html +++ b/templates/user.html @@ -5,11 +5,19 @@ {{if .Error}}

{{.Error}}

{{end}} + {{if ne .UserImpersonation ""}} +
+ {{else}} + {{end}}
+ {{if ne .UserImpersonation ""}} +
+ {{else}} + {{end}}
@@ -39,7 +47,11 @@
+ {{if ne .UserImpersonation ""}} + + {{else}} + {{end}} {{end}} -- cgit v1.2.3