]> git.parisson.com Git - teleforma.git/commitdiff
add TELEFORMA_EXAM_SCRIPT_UPLOAD to settings to display/hide script uploads
authorGuillaume Pellerin <yomguy@parisson.com>
Wed, 3 Sep 2014 10:46:06 +0000 (12:46 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Wed, 3 Sep 2014 10:46:06 +0000 (12:46 +0200)
example/settings.py
teleforma/exam/templates/exam/script_form.html
teleforma/exam/templates/exam/scripts.html
teleforma/exam/views.py

index 3e4576ac6190301101f6ef490495015d0013c9cb..599ddceec24a6cfe08709f54dedd2cb4283bab1b 100644 (file)
@@ -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
index 725ef3cb36d44defef83f60f219bb04ce565285b..ca4f6ecac05b03a3ac5257cfb4e26d7681184fa9 100644 (file)
@@ -5,6 +5,7 @@
 {% load thumbnail %}
 
 {% block extra_javascript %}
+{% if upload %}
   <script>
     $(document).ready(function(){
         $('#loading').hide();
@@ -22,6 +23,7 @@
         });
     });
     </script>
+{% endif %}
 {% endblock extra_javascript %}
 
 {% block answers %}
        {% endfor %}
        </table>
     </form>
+    {% if upload %}
     <br />
     <center>
     <a href="#" id="submit_button" class="component_icon button icon_next">{% trans "Submit" %}</a>
     <img id="loading" src="{{STATIC_URL}}teleforma/images/loading.gif" style="vertical-align:middle" alt="loading" />
     </center>
+    {% endif %}
     <br /><br />
 
 </div>
index 18b6e6e1db83ceecc7bfabc36ce39466129ab1db..e4d579f20be5ee593e01f20f8f582bc0fa809ce1 100644 (file)
  </div>
 </div>
 
+
+{% if upload %}
 {% block module-action %}
 <div class="module_action">
 <a href="{% url teleforma-exam-script-create period.id %}" class="component_icon button" id="action_green">{% trans "New script" %}</a>
 </div>
 {% endblock module-action %}
+{% endif %}
 
 {% endblock modules %}
 
index 687c1c430104b0e57ef5656d5088cb4e5e4dc06c..7549b5882dc985acb47317c6254c3058f2f16dea 100644 (file)
@@ -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)