From 09a34dda989df0f74bbfcd11ac63254d61b92a18 Mon Sep 17 00:00:00 2001 From: Julian Hurst Date: Sun, 15 Jan 2023 02:16:35 +0100 Subject: Add images support (inf scroll via htmx of images taken from user docs) This commit also includes a migration from css to scss, some improvements to the redirection workflow when no session is found and refactors concerning flash cookies. --- templates/base.html | 1 + templates/imgs.html | 6 ++++++ templates/imgs_page.html | 17 +++++++++++++++++ templates/imgs_stub.html | 1 + templates/login.html | 4 ++-- templates/nav_logged.html | 3 ++- templates/user.html | 2 +- 7 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 templates/imgs.html create mode 100644 templates/imgs_page.html create mode 100644 templates/imgs_stub.html (limited to 'templates') diff --git a/templates/base.html b/templates/base.html index c2ca497..653570d 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,6 +1,7 @@ + {{block "title" .}}{{end}} - docspace diff --git a/templates/imgs.html b/templates/imgs.html new file mode 100644 index 0000000..9b584a8 --- /dev/null +++ b/templates/imgs.html @@ -0,0 +1,6 @@ +{{define "title"}}Acceuil{{end}} +{{define "content"}} +

Images

+ {{template "imgspage" .}} + {{.NbFiles}} images +{{end}} diff --git a/templates/imgs_page.html b/templates/imgs_page.html new file mode 100644 index 0000000..665daf3 --- /dev/null +++ b/templates/imgs_page.html @@ -0,0 +1,17 @@ +{{define "imgspage"}} +{{range $i, $img := .Imgs}} + {{if eq (add $i $.Start) $.End}} +
+ {{$img.Name}}
+
+ {{else}} +
+ {{$img.Name}}
+
+ {{end}} +
+
+{{end}} +{{end}} diff --git a/templates/imgs_stub.html b/templates/imgs_stub.html new file mode 100644 index 0000000..a1c542b --- /dev/null +++ b/templates/imgs_stub.html @@ -0,0 +1 @@ +{{template "imgspage" .}} diff --git a/templates/login.html b/templates/login.html index e1b4c44..5e717c3 100644 --- a/templates/login.html +++ b/templates/login.html @@ -5,8 +5,8 @@

{{.Error}}

{{end}}
-

-

+

+

{{end}} diff --git a/templates/nav_logged.html b/templates/nav_logged.html index a62585f..50e9a36 100644 --- a/templates/nav_logged.html +++ b/templates/nav_logged.html @@ -1,8 +1,9 @@ {{define "nav"}} diff --git a/templates/user.html b/templates/user.html index f116286..cd0d98c 100644 --- a/templates/user.html +++ b/templates/user.html @@ -27,7 +27,7 @@ {{.Name}} - {{.ModTime}} + {{formatmodtime .ModTime}} {{.Size}} -- cgit v1.2.3