1. akoha
  2. django-lean

Commits

Juan Pablo Di Lelle  committed 7d8930a

Moved the experiment_enrollment.html file to media/experiments/ so that it can be served like experiments.js .

  • Participants
  • Parent commits f9cdddb
  • Branches default

Comments (0)

Files changed (4)

File MANIFEST.in

View file
 include AUTHORS
 include README
 
+recursive-include django_lean/experiments/media *.html *.js
 recursive-include django_lean/experiments/templates *.html *.js
 recursive-include django_lean/experiments/tests/data *.json

File django_lean/experiments/media/experiments/experiment_enrollment.html

View file
+{% if client_side_experiments or not request.session.verified_human %}
+  <script type="text/javascript" charset="utf-8">
+    {% if not request.session.verified_human %}
+      experiments.confirm_human();
+    {% endif %}
+    {% if client_side_experiments %}
+      {% for experiment, group in client_side_experiments.items %}
+        experiments.record_enrollment("{{ experiment|escapejs }}", "{{ group|escapejs }}");
+      {% endfor %}
+    {% endif %}
+  </script>
+{% endif %}

File django_lean/experiments/templates/experiments/include/experiment_enrollment.html

-{% if client_side_experiments or not request.session.verified_human %}
-  <script type="text/javascript" charset="utf-8">
-    {% if not request.session.verified_human %}
-      experiments.confirm_human();
-    {% endif %}
-    {% if client_side_experiments %}
-      {% for experiment, group in client_side_experiments.items %}
-        experiments.record_enrollment("{{ experiment|escapejs }}", "{{ group|escapejs }}");
-      {% endfor %}
-    {% endif %}
-  </script>
-{% endif %}

File setup.py

View file
         'django_lean.lean_segments.management.commands',
     ],
     package_data={
-        'django_lean.experiments': ['templates/experiments/*.html',
+        'django_lean.experiments': ['media/experiments/*.js',
+                                    'media/experiments/*.html',
+                                    'templates/experiments/*.html',
                                     'templates/experiments/include/*.html',
                                     'templates/experiments/include/*.js'],
         'django_lean.experiments.tests': ['data/*.json'],