We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eef534e commit 4541e38Copy full SHA for 4541e38
templates/index.html
@@ -68,7 +68,11 @@ <h1>Endless Task List App using Flask</h1>
68
{% if not task.completed %}<!--show complete button if task is not completed-->
69
<a href="/complete_task/{{ task.id }}">Complete</a>
70
{% endif %}
71
- <a href="/delete_task/{{ task.id }}">Delete</a>
+ <a
72
+ href="/delete_task/{{ task.id }}"
73
+ onclick="return {{ 'confirm(\'Are you sure you want to delete this task?\')' if not task.completed else 'true' }}"
74
+ >Delete</a
75
+ ><!--confirm user to delete the task if task is not completed, if task is completed don't alert user to confirm task deletion-->
76
{% endfor %}
77
</ul>
78
0 commit comments