changeset 283:a50075db625c

bulma (photo/item): show videos and their thumbnails
author Goffi <goffi@goffi.org>
date Tue, 25 Aug 2020 08:45:35 +0200
parents 46eee98c19d8
children 671085989f2f
files sat_templates/templates/bulma/photo/item.html
diffstat 1 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/sat_templates/templates/bulma/photo/item.html	Tue Aug 25 08:43:32 2020 +0200
+++ b/sat_templates/templates/bulma/photo/item.html	Tue Aug 25 08:45:35 2020 +0200
@@ -1,9 +1,20 @@
 <div class="column is-4 item" data-item='{{file|tojson}}'>
     <div class="card x-is-hoverable">
         <div class="card-image is-photo-thumbnail-container is-flex has-items-centered has-background-light">
-            <a href="{{file.url}}" class="is-wrapping photo_thumb_click">
-                <img class="is-photo-thumbnail" src="{{file.thumb_url}}" alt="{{file.name}}">
-            </a>
+            {% if file.mime_type[:5] == 'video' %}
+                <a href="{{file.url}}" class="is-video-thumbnail-wrapper is-wrapping photo_thumb_click">
+                    <img class="is-photo-thumbnail" src="{{file.thumb_url}}">
+                    <div class="media_overlay_play is-flex has-items-centered">
+                        <span class="icon">
+                            <i class="icon-play-circled"></i>
+                        </span>
+                    </div>
+                </a>
+            {% else %}
+                <a href="{{file.url}}" class="is-wrapping photo_thumb_click">
+                    <img class="is-photo-thumbnail" src="{{file.thumb_url}}" alt="{{file.name}}">
+                </a>
+            {% endif %}
         </div>
         <div class="card-content" onclick="clicked_mh_fix('{{'comments_panel'|next_gidx}}')">
             <div class="level">