From d2a9e162352646e7f1550823c3d88496590f8760 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Thu, 17 Aug 2023 21:38:27 +0200 Subject: ref: Update mosaic to remove empty spaces --- templates/media.qtpl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'templates/media.qtpl') diff --git a/templates/media.qtpl b/templates/media.qtpl index 11fc9bc..7dcdf54 100644 --- a/templates/media.qtpl +++ b/templates/media.qtpl @@ -1,4 +1,5 @@ {% import "git.sr.ht/~gabrielgio/img/pkg/database/repository" %} +{% import "git.sr.ht/~gabrielgio/img/pkg/list" %} {% code type MediaPage struct { @@ -18,8 +19,10 @@ func (m *MediaPage) PreloadAttr() string { {% func (p *MediaPage) Title() %}Media{% endfunc %} {% func (p *MediaPage) Content() %} -
-{% for _, media := range p.Medias %} +
+{% for _, c := range list.Chunck(p.Medias, 4) %} +
+ {% for _, media := range c %}
{% if media.IsVideo() %}
+ {% endfor %} +
{% endfor %}
-- cgit v1.2.3