diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-08-17 21:38:27 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-08-17 21:38:27 +0200 |
commit | d2a9e162352646e7f1550823c3d88496590f8760 (patch) | |
tree | f1dfe1f93e8d943443239d804569ec8ca7beb9f8 /templates/media.qtpl | |
parent | 969b7600a86185187cd17d45bd252143db4a6728 (diff) | |
download | lens-d2a9e162352646e7f1550823c3d88496590f8760.tar.gz lens-d2a9e162352646e7f1550823c3d88496590f8760.tar.bz2 lens-d2a9e162352646e7f1550823c3d88496590f8760.zip |
ref: Update mosaic to remove empty spaces
Diffstat (limited to 'templates/media.qtpl')
-rw-r--r-- | templates/media.qtpl | 9 |
1 files changed, 7 insertions, 2 deletions
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() %} -<div class="columns is-multiline"> -{% for _, media := range p.Medias %} +<div class="columns"> +{% for _, c := range list.Chunck(p.Medias, 4) %} + <div class="column is-3"> + {% for _, media := range c %} <div class="card-image"> {% if media.IsVideo() %} <video class="image is-fit" controls muted="true" poster="/media/thumbnail/?path_hash={%s media.PathHash %}" preload="{%s p.PreloadAttr() %}"> @@ -31,6 +34,8 @@ func (m *MediaPage) PreloadAttr() string { </figure> {% endif %} </div> + {% endfor %} + </div> {% endfor %} </div> <div> |