From a1f09d1f143012570a62bcb2a8fe51c439ad68fb Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Fri, 18 Aug 2023 21:57:47 +0200 Subject: feat: Make mosaic reusable --- templates/mosaic.qtpl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 templates/mosaic.qtpl (limited to 'templates/mosaic.qtpl') diff --git a/templates/mosaic.qtpl b/templates/mosaic.qtpl new file mode 100644 index 0000000..18dbcba --- /dev/null +++ b/templates/mosaic.qtpl @@ -0,0 +1,24 @@ +{% import "git.sr.ht/~gabrielgio/img/pkg/database/repository" %} +{% import "git.sr.ht/~gabrielgio/img/pkg/list" %} + +{% func Mosaic(medias []*repository.Media, preloadAttr string) %} +
+{% for _, c := range list.Distribuite(medias, 6) %} +
+ {% for _, media := range c %} +
+ {% if media.IsVideo() %} + + {% else %} +
+ +
+ {% endif %} +
+ {% endfor %} +
+{% endfor %} +
+{% endfunc %} -- cgit v1.2.3