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/album.qtpl | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'templates/album.qtpl') diff --git a/templates/album.qtpl b/templates/album.qtpl index 328c6d4..1f25bf6 100644 --- a/templates/album.qtpl +++ b/templates/album.qtpl @@ -1,5 +1,4 @@ {% import "git.sr.ht/~gabrielgio/img/pkg/database/repository" %} -{% import "git.sr.ht/~gabrielgio/img/pkg/list" %} {% code type AlbumPage struct { @@ -28,26 +27,10 @@ func (m *AlbumPage) PreloadAttr() string { {% endfor %}
-{% 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