]> git.parisson.com Git - teleforma.git/commitdiff
authorized video download to perms.telemeta.can_play_all_items
authorGuillaume Pellerin <yomguy@parisson.com>
Fri, 12 Apr 2013 12:55:52 +0000 (14:55 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Fri, 12 Apr 2013 12:55:52 +0000 (14:55 +0200)
teleforma/templates/teleforma/course_media.html

index 446cc2aa1ec8a353fa95317839f399495702ce10..19795c11887fbc0d996ad9eb7a8c8d5e934db9d3 100644 (file)
@@ -58,10 +58,12 @@ $(document).ready(function(){
 {% endblock extra_javascript %}
 
 {% block module-action %}
-{% if media.item.file and media.is_published and not "video" in media.mime_type %}
-<div class="module_action">
-<a href="{{ MEDIA_URL }}{{ media.item.file }}" class="component_icon button" id="action_red"><img src="{{STATIC_URL}}teleforma/images/download_media.png" alt="" style="vertical-align:middle" />&nbsp;{% trans "Download" %}</a>
-</div>
+{% if media.item.file and media.is_published %}
+ {% if not "video" in media.mime_type or perms.telemeta.can_play_all_items %}
+  <div class="module_action">
+   <a href="{{ MEDIA_URL }}{{ media.item.file }}" class="component_icon button" id="action_red"><img src="{{STATIC_URL}}teleforma/images/download_media.png" alt="" style="vertical-align:middle" />&nbsp;{% trans "Download" %}</a>
+  </div>
+ {% endif %}
 {% endif %}
 {% endblock module-action %}