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:
Disco DeDisco
2026-03-04 15:13:16 -05:00
parent a218391ea5
commit 9548a2cd15
6 changed files with 88 additions and 4 deletions

View File

@@ -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>