From 99a81911b529185e424dfab49a91ad23ca8ecec7 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 9 Jul 2024 12:30:55 +0200 Subject: [PATCH] add settings.TELFORMA_MEDIA_DOWNLOAD --- app/settings.py | 2 ++ teleforma/templates/teleforma/course_media.html | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/settings.py b/app/settings.py index 1eacf48e..4e6991c3 100644 --- a/app/settings.py +++ b/app/settings.py @@ -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 diff --git a/teleforma/templates/teleforma/course_media.html b/teleforma/templates/teleforma/course_media.html index 65af2174..0314136e 100644 --- a/teleforma/templates/teleforma/course_media.html +++ b/teleforma/templates/teleforma/course_media.html @@ -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' %} -
-  {% trans "Download" %} -
- {% 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' %} +
+  {% trans "Download" %} +
+ {% endif %} + {% endif %} {% endif %} {% endblock module-action %} -- 2.39.5