From 0670c450d3119bbcf1131dcae85c9b856420dc05 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Wed, 3 Sep 2014 12:46:06 +0200 Subject: [PATCH] add TELEFORMA_EXAM_SCRIPT_UPLOAD to settings to display/hide script uploads --- example/settings.py | 1 + teleforma/exam/templates/exam/script_form.html | 4 ++++ teleforma/exam/templates/exam/scripts.html | 3 +++ teleforma/exam/views.py | 1 + 4 files changed, 9 insertions(+) diff --git a/example/settings.py b/example/settings.py index 3e4576ac..599ddcee 100644 --- a/example/settings.py +++ b/example/settings.py @@ -200,6 +200,7 @@ TELEFORMA_E_LEARNING_TYPE = 'CRFPA' TELEFORMA_GLOBAL_TWEETER = False TELEFORMA_PERIOD_TWEETER = True TELEFORMA_EXAM_TOPIC_DEFAULT_DOC_TYPE_NUMBER = 2 +TELEFORMA_EXAM_SCRIPT_UPLOAD = True JQCHAT_DISPLAY_COUNT = 50 JQCHAT_DISPLAY_TIME = 48 diff --git a/teleforma/exam/templates/exam/script_form.html b/teleforma/exam/templates/exam/script_form.html index 725ef3cb..ca4f6eca 100644 --- a/teleforma/exam/templates/exam/script_form.html +++ b/teleforma/exam/templates/exam/script_form.html @@ -5,6 +5,7 @@ {% load thumbnail %} {% block extra_javascript %} +{% if upload %} +{% endif %} {% endblock extra_javascript %} {% block answers %} @@ -58,11 +60,13 @@ {% endfor %} + {% if upload %}
{% trans "Submit" %} loading
+ {% endif %}

diff --git a/teleforma/exam/templates/exam/scripts.html b/teleforma/exam/templates/exam/scripts.html index 18b6e6e1..e4d579f2 100644 --- a/teleforma/exam/templates/exam/scripts.html +++ b/teleforma/exam/templates/exam/scripts.html @@ -33,11 +33,14 @@ + +{% if upload %} {% block module-action %}
{% trans "New script" %}
{% endblock module-action %} +{% endif %} {% endblock modules %} diff --git a/teleforma/exam/views.py b/teleforma/exam/views.py index 687c1c43..7549b588 100644 --- a/teleforma/exam/views.py +++ b/teleforma/exam/views.py @@ -60,6 +60,7 @@ class ScriptsView(ListView): def get_context_data(self, **kwargs): context = super(ScriptsView, self).get_context_data(**kwargs) context['period'] = Period.objects.get(id=self.kwargs['period_id']) + context['upload'] = getattr(settings, 'TELEFORMA_EXAM_SCRIPT_UPLOAD', True) return context @method_decorator(login_required) -- 2.39.5