diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-10-06 18:30:34 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-10-06 18:41:13 +0200 |
commit | 99a7e9ab02ae1980874be35f6a2651ca4bfdb951 (patch) | |
tree | 71d4a3f2a7e7df2b527344158dc8b7c684fef518 /templates/mosaic.qtpl | |
parent | 91f7c40479aa9ef18c7927913be49a014a8a3115 (diff) | |
download | lens-99a7e9ab02ae1980874be35f6a2651ca4bfdb951.tar.gz lens-99a7e9ab02ae1980874be35f6a2651ca4bfdb951.tar.bz2 lens-99a7e9ab02ae1980874be35f6a2651ca4bfdb951.zip |
feat: Simplify mosaic
The old implementation was not good and would render the list on mobile
in the wrong order
Diffstat (limited to 'templates/mosaic.qtpl')
-rw-r--r-- | templates/mosaic.qtpl | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/templates/mosaic.qtpl b/templates/mosaic.qtpl index 21a8bae..9e941b6 100644 --- a/templates/mosaic.qtpl +++ b/templates/mosaic.qtpl @@ -1,26 +1,13 @@ {% import "git.sr.ht/~gabrielgio/img/pkg/database/repository" %} -{% import "git.sr.ht/~gabrielgio/img/pkg/list" %} {% func Mosaic(medias []*repository.Media, preloadAttr string) %} -<div class="columns"> -{% for _, c := range list.Distribuite(medias, 6) %} - <div class="column is-2"> - {% for _, media := range c %} - <div class="card-image"> - <a href="/detail?path_hash={%s media.PathHash %}"> - {% if media.IsVideo() %} - <video class="image is-fit" controls muted="true" poster="/media/thumbnail?path_hash={%s media.PathHash %}" preload="{%s preloadAttr %}"> - <source src="/media/image?path_hash={%s media.PathHash %}" type="{%s media.MIMEType %}"> - </video> - {% else %} - <figure class="image is-fit"> - <img src="/media/thumbnail?path_hash={%s media.PathHash %}"> - </figure> - </a> - {% endif %} - </div> - {% endfor %} - </div> +<div class="gallary_container"> +{% for _, media := range medias %} + <a href="/detail?path_hash={%s media.PathHash %}"> + <figure class="image_container"> + <img src="/media/thumbnail?path_hash={%s media.PathHash %}" > + </figure> + </a> {% endfor %} </div> {% endfunc %} |