From 52276ba99540d6c61195772ccdd50944e96f4959 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Wed, 19 Jul 2023 20:24:19 +0200 Subject: feat: Move settings from `html/template` to qtpl --- templates/settings.html | 44 -------------------------------------- templates/settings.qtpl | 56 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 44 deletions(-) delete mode 100644 templates/settings.html create mode 100644 templates/settings.qtpl (limited to 'templates') diff --git a/templates/settings.html b/templates/settings.html deleted file mode 100644 index 8c08773..0000000 --- a/templates/settings.html +++ /dev/null @@ -1,44 +0,0 @@ -{{template "layout.html" .}} -{{define "title"}} {{.Title}} {{end}} -{{define "content"}} -
-
-
-
-
- -
-
-
-
- -
-
-
- -
-
-
-
- {{range .Data.Users}} -
-
-
- {{.Username}} -
-
- {{.Path}} -
- -
-
- {{end}} -
-
-{{end}} diff --git a/templates/settings.qtpl b/templates/settings.qtpl new file mode 100644 index 0000000..509cddd --- /dev/null +++ b/templates/settings.qtpl @@ -0,0 +1,56 @@ +{% import "git.sr.ht/~gabrielgio/img/pkg/database/repository" %} + +{% code +type SettingsPage struct { + Settings *repository.Settings + Users []*repository.User +} +%} + +{% func (p *SettingsPage) Title() %}Settings{% endfunc %} + +{% func (p *SettingsPage) Content() %} +
+
+
+
+
+ +
+
+
+
+ +
+
+
+ +
+
+
+
+ {% for _, user := range p.Users %} +
+
+
+ {%s user.Username %} +
+
+ {%s user.Path %} +
+ +
+
+ {% endfor %} +
+
+{% endfunc %} + +{% func (p *SettingsPage) Script() %} +{% endfunc %} -- cgit v1.2.3