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/media.qtpl | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'templates/media.qtpl') diff --git a/templates/media.qtpl b/templates/media.qtpl index 7dcdf54..737d03d 100644 --- a/templates/media.qtpl +++ b/templates/media.qtpl @@ -1,5 +1,4 @@ {% import "git.sr.ht/~gabrielgio/img/pkg/database/repository" %} -{% import "git.sr.ht/~gabrielgio/img/pkg/list" %} {% code type MediaPage struct { @@ -20,26 +19,10 @@ func (m *MediaPage) PreloadAttr() string { {% func (p *MediaPage) Content() %}
-{% for _, c := range list.Chunck(p.Medias, 4) %} -
- {% for _, media := range c %} -
- {% if media.IsVideo() %} - - {% else %} -
- -
- {% endif %} -
- {% endfor %} -
-{% endfor %} +{%= Mosaic(p.Medias, p.PreloadAttr()) %}
- next + next
{% endfunc %} -- cgit v1.2.3