diff sat_templates/templates/bulma/base/base.html @ 237:caa3767707fb

base/base.html: expose CSRF token to script + fixed script content
author Goffi <goffi@goffi.org>
date Fri, 19 Jun 2020 17:57:01 +0200
parents 0e69b5843c2f
children a62822c6a114
line wrap: on
line diff
--- a/sat_templates/templates/bulma/base/base.html	Fri Jun 19 16:53:20 2020 +0200
+++ b/sat_templates/templates/bulma/base/base.html	Fri Jun 19 17:57:01 2020 +0200
@@ -58,10 +58,14 @@
         </style>
     {% endif %}
 
+    {% if csrf_token is defined %}
+        <script>var csrf_token = "{{csrf_token}}";</script>
+    {% endif %}
+
     {{ script.generate_scripts() }}
 
     {% for script in scripts %}
-        <script{{ {'src': script.src, 'type': script.type} | xmlattr }}>{{script.content}}</script>
+        <script{{ {'src': script.src, 'type': script.type} | xmlattr }}>{{script.content|safe}}</script>
     {% endfor %}
 
     {% block favicon %}