Add the update button for a task.
This commit is contained in:
@@ -4,6 +4,10 @@
|
||||
<form method="POST">
|
||||
{% csrf_token %}
|
||||
{{ task_form|crispy }}
|
||||
<button type="submit" hx-post=".">Submit</button>
|
||||
{% if task %}
|
||||
<button type="submit" hx-post="{% url 'tasks:task-update' task.id %}">Submit</button>
|
||||
{% else %}
|
||||
<button type="submit" hx-post=".">Submit</button>
|
||||
{% endif %}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -11,6 +11,11 @@
|
||||
<p class="font-semibold">{{ task.name }}</p>
|
||||
<p>{{ task.description | truncatewords:10 }}</p>
|
||||
|
||||
<button type="button"
|
||||
hx-post="{% url 'tasks:task-update' task.id %}"
|
||||
hx-swap="outerHTML">
|
||||
Update
|
||||
</button>
|
||||
<button type="button"
|
||||
hx-post="{% url 'tasks:task-delete' task.id %}"
|
||||
hx-swap="outerHTML">
|
||||
|
||||
Reference in New Issue
Block a user