Add logic to swap the form with the task via htmx.

This commit is contained in:
2023-07-15 18:04:28 +03:00
parent a0aaef3458
commit c66712d0f4
4 changed files with 46 additions and 3 deletions
+5 -1
View File
@@ -4,7 +4,11 @@
{% block content %}
<h1 class="text-3xl font-bold text-center my-2">Tasks</h1>
<div class="flex flex-col">
<button type="button" hx-get="{% url 'tasks:create-task-form' %}" hx-target="#task-items" hx-swap="beforeend">
Add a new task
</button>
<div id="task-items" class="flex flex-col">
{% for task in tasks %}
{% include "partials/task_item.html" %}
{% endfor %}