added locally hosted htmx dependency; updated base.html template & req's files accordingly; wrote new FT (failing) in test_dashboard that calls for this lib
This commit is contained in:
@@ -77,9 +77,27 @@
|
||||
{% endblock content %}
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
{% block scripts %}
|
||||
{% endblock scripts %}
|
||||
|
||||
{% block scripts %}
|
||||
{% endblock scripts %}
|
||||
<script src="{% static "vendor/htmx.min.js" %}"></script>
|
||||
<script>
|
||||
document.body.addEventListener('htmx:configRequest', function(evt) {
|
||||
evt.detail.headers['X-CSRFToken'] = getCookie('csrftoken');
|
||||
});
|
||||
function getCookie(name) {
|
||||
let val = null;
|
||||
if (document.cookie) {
|
||||
for (let c of document.cookie.split(';')) {
|
||||
c = c.trim();
|
||||
if (c.startsWith(name + '=')) {
|
||||
val = decodeURIComponent(c.substring(name.length + 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return val;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user