From 55448bc974f71f83e6a6c6d70afe9cfc63d275f4 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Tue, 18 Jul 2023 23:20:15 +0200 Subject: feat: Move media from `html/template` to qtpl --- templates/media.qtpl | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 templates/media.qtpl (limited to 'templates/media.qtpl') diff --git a/templates/media.qtpl b/templates/media.qtpl new file mode 100644 index 0000000..88ce582 --- /dev/null +++ b/templates/media.qtpl @@ -0,0 +1,37 @@ +{% import "git.sr.ht/~gabrielgio/img/pkg/database/repository" %} + +{% code +type MediaPage struct { + Medias []*repository.Media + Next *repository.Pagination +} +%} + +{% func (p *MediaPage) Title() %} +Media +{% endfunc %} + + +{% func (p *MediaPage) Content() %} +
+{% for _, media := range p.Medias %} +
+ {% if media.IsVideo() %} + + {% else %} +
+ +
+ {% endif %} +
+{% endfor %} +
+
+ next +
+{% endfunc %} + +{% func (p *MediaPage) Script() %} +{% endfunc %} -- cgit v1.2.3