Parcourir la source

Fix: Experiment indications scripts are loaded twice #3

Jérôme BUISINE il y a 4 ans
Parent
commit
101f2c9bdd

+ 1 - 1
expe/config.py

@@ -44,7 +44,7 @@ expes_configuration         = {
         'template': 'expe/expe.html',
 
         # javascript file used
-        'js':[
+        'javascript':[
             'loadImg.js',
             'keyEvents.js'
         ],

+ 1 - 1
expe/templates/base.html

@@ -50,7 +50,7 @@
     {% endblock %}
 
     <!-- Dynamically load JS file of experience -->
-    {% for file in js %}
+    {% for file in javascript %}
         {% with 'js/'|add:file as js_static %}
             <script src="{% static js_static %}"></script>
         {% endwith %}

+ 5 - 4
expe/templates/expe/expe_indications.html

@@ -13,8 +13,9 @@
     <h5>{{indication}}</h5>
 
     <p id="expeIndication"><strong>Press enter to begin experience</strong></p>
-    
-    {% block javascripts %}
-        <script src="{% static "js/indications.js" %}"></script>
-    {% endblock %}
+
+{% endblock %}
+
+{% block javascripts %}
+    <script src="{% static "js/indications.js" %}"></script>
 {% endblock %}

+ 8 - 8
expe/templates/expe/expe_results.html

@@ -73,13 +73,13 @@
             {% endfor %}
         {% endif %}
     </div>
+{% endblock %}
 
-    {% block javascripts %}
-        <script type="text/javascript"> 
-            // Utils informations
-            var expe_name = "{{expe}}"
-        </script>
-        <script src="{% static "js/results.js" %}"></script>
-        <script src="{% static "js/FileSaver.js" %}"></script>
-    {% endblock %}
+{% block javascripts %}
+    <script type="text/javascript"> 
+        // Utils informations
+        var expe_name = "{{expe}}"
+    </script>
+    <script src="{% static "js/results.js" %}"></script>
+    <script src="{% static "js/FileSaver.js" %}"></script>
 {% endblock %}