From 91f7c40479aa9ef18c7927913be49a014a8a3115 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Sun, 1 Oct 2023 16:29:10 +0200 Subject: feat: Add detail page --- templates/detail.qtpl | 34 ++++++++++++++++++++++++++++++++++ templates/mosaic.qtpl | 8 +++++--- 2 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 templates/detail.qtpl (limited to 'templates') diff --git a/templates/detail.qtpl b/templates/detail.qtpl new file mode 100644 index 0000000..a981be9 --- /dev/null +++ b/templates/detail.qtpl @@ -0,0 +1,34 @@ +{% import "git.sr.ht/~gabrielgio/img/pkg/database/repository" %} + +{% code +type DetailPage struct { + Media *repository.Media + Settings *repository.Settings +} + +func (m *DetailPage) PreloadAttr() string { + if m.Settings.PreloadVideoMetadata { + return "metadata" + } + return "none" +} +%} + +{% func (p *DetailPage) Title() %}Media{% endfunc %} + +{% func (p *DetailPage) Content() %} +
+ {% if p.Media.IsVideo() %} + + {% else %} +
+ +
+ {% endif %} +
+{% endfunc %} + +{% func (p *DetailPage) Script() %} +{% endfunc %} diff --git a/templates/mosaic.qtpl b/templates/mosaic.qtpl index 18dbcba..21a8bae 100644 --- a/templates/mosaic.qtpl +++ b/templates/mosaic.qtpl @@ -7,14 +7,16 @@
{% for _, media := range c %} {% endfor %} -- cgit v1.2.3