]> git.parisson.com Git - teleforma.git/commitdiff
add settings.TELFORMA_MEDIA_DOWNLOAD
authorGuillaume Pellerin <guillaume.pellerin@free.fr>
Tue, 9 Jul 2024 10:30:55 +0000 (12:30 +0200)
committerGuillaume Pellerin <guillaume.pellerin@free.fr>
Tue, 9 Jul 2024 10:30:55 +0000 (12:30 +0200)
app/settings.py
teleforma/templates/teleforma/course_media.html

index 1eacf48eb0931889a30ff07282a5e2fdffdb040b..4e6991c3a6f3ad2bf46613407be6f591d8f6713d 100644 (file)
@@ -595,6 +595,8 @@ TELEFORMA_EXAM_SCRIPT_MAX_SIZE = 31457280
 TELEFORMA_EXAM_SCRIPT_SERVICE_URL = '/webviewer/teleforma.html'
 TELEFORMA_PRIVATE_DOCUMENTS_MODE = True
 TELEFORMA_PRIVATE_MEDIA_USE_S3 = True
+TELFORMA_MEDIA_DOWNLOAD = False
+
 ORAL_OPTION_PRICE = 250
 # use to share correction doc / media accross different training
 CORRECTIONS_COURSE_TYPE_ID = 2
index 65af2174ba628f9dde4125f94ac48c1e4a9525d3..0314136e09d8c8a1b370d0f605c4aaceadb38603 100644 (file)
@@ -51,12 +51,14 @@ $(document).ready(function(){
 {% endblock extra_javascript %}
 
 {% block module-action %}
-{% if media.file and media.conference.status == 3 or user.is_superuser or user.is_staff %}
- {% if not "video" in media.mime_type or request.user_agent.os.family == 'iOS' %}
-  <div class="module_action">
-   <a href="{{ MEDIA_URL }}{{ media.item.file }}" class="component_icon button" id="action_red" download><img src="/static/teleforma/images/download_media.png" alt="" style="vertical-align:middle" />&nbsp;{% trans "Download" %}</a>
-  </div>
- {% endif %}
+{% if value_from_settings TELFORMA_MEDIA_DOWNLOAD %}
+    {% if media.file and media.conference.status == 3 or user.is_superuser or user.is_staff %}
+        {% if not "video" in media.mime_type or request.user_agent.os.family == 'iOS' %}
+            <div class="module_action">
+                <a href="{{ MEDIA_URL }}{{ media.item.file }}" class="component_icon button" id="action_red" download><img src="/static/teleforma/images/download_media.png" alt="" style="vertical-align:middle" />&nbsp;{% trans "Download" %}</a>
+            </div>
+        {% endif %}
+    {% endif %}
 {% endif %}
 {% endblock module-action %}