]> git.parisson.com Git - teleforma.git/commitdiff
add preview to audio view
authoryomguy <yomguy@parisson.com>
Sat, 28 Jul 2012 22:26:49 +0000 (00:26 +0200)
committeryomguy <yomguy@parisson.com>
Sat, 28 Jul 2012 22:26:49 +0000 (00:26 +0200)
teleforma/templates/teleforma/course_media.html

index dc86db50d570f4379861551af7f140d89365d970..739245fa4b206bef0f3ef3f98e54e02483a634ca 100644 (file)
@@ -100,6 +100,17 @@ $(document).ready(function(){
 </div>
 
 {% elif "audio" in media.mime_type %}
+
+{% if media.item.related.all %}
+ {% for related in media.item.related.all %}
+  {% if related.title == "preview" %}
+   <img src="{{ MEDIA_URL }}{{ related.file }}" width="320px" alt="" />
+  {% endif %}
+ {% endfor %}
+{% else %}
+ snapshot
+{% endif %}
+
 <div class="audio" style="margin-top:1em;">
 <audio controls preload="auto">
 <source src="{{ MEDIA_URL }}{{ media.item.file }}" type="{{ media.mime_type }}" />