]> git.parisson.com Git - teleforma.git/commitdiff
add download button for admins
authorGuillaume Pellerin <yomguy@parisson.com>
Fri, 17 May 2013 10:15:48 +0000 (12:15 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Fri, 17 May 2013 10:15:48 +0000 (12:15 +0200)
teleforma/templates/teleforma/course_media.html
teleforma/views/core.py

index 19795c11887fbc0d996ad9eb7a8c8d5e934db9d3..c57eb0bc9a3b38977bcff597428d0a50008f21de 100644 (file)
@@ -58,7 +58,7 @@ $(document).ready(function(){
 {% endblock extra_javascript %}
 
 {% block module-action %}
-{% if media.item.file and media.is_published %}
+{% if media.item.file and media.is_published or user.is_superuser or user.is_staff %}
  {% 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>
index 09caa4fd4e2d75fe7a459994140074edc8572d12..867097c3a3748a648ff67067e82bda3253613517 100644 (file)
@@ -99,7 +99,7 @@ def format_courses(courses, course=None, queryset=None, types=None):
     return courses
 
 
-def get_courses(user, date_order=False, num_order=False):
+def get_courses(user, date_order=False, num_order=False, num_courses=False):
     if settings.TELEFORMA_E_LEARNING_TYPE == 'CRFPA':
         from teleforma.views.crfpa import get_crfpa_courses
         return get_crfpa_courses(user, date_order, num_order)