46 lines
1.8 KiB
HTML
46 lines
1.8 KiB
HTML
<li
|
|
class="todo__item"
|
|
data-controller="todo"
|
|
data-todo-url-value="{% url 'todo-update' employee.pk todo.pk %}"
|
|
data-todo-delete-url-value="{% url 'todo-delete' employee.pk todo.pk %}"
|
|
>
|
|
<div class="todo_display"
|
|
data-todo-target="display"
|
|
>
|
|
<span
|
|
data-action="click->todo#toggle"
|
|
class="todo__checkbox_button {% if todo.completed %}todo__checkbox_button--completed{% endif %}"></span>
|
|
<span class="todo__description_display">{{todo.description}}</span>
|
|
<span class="todo__due_date">{% if todo.due_date %}{{todo.due_date}}{% endif %}</span>
|
|
<div class="todo__actions">
|
|
{% if not employee.archived %}
|
|
<button class="hidden_action" data-action="todo#edit" name="edit">edit</button>
|
|
<button class="hidden_action" data-action="todo#destroy" name="destroy">delete</button>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<form
|
|
class="todo_form --hidden"
|
|
data-todo-target="form"
|
|
data-action="todo#post"
|
|
data-action="change->todo#change"
|
|
action="{% url 'todo-update' employee.pk todo.pk %}"
|
|
method="POST">
|
|
{% csrf_token %}
|
|
<input
|
|
data-action="todo#post"
|
|
data-todo-target="checkbox"
|
|
class="todo__checkbox_input"
|
|
name="completed"
|
|
type="checkbox"
|
|
{% if todo.completed %}checked{% endif %}
|
|
{% if employee.archived %}disabled{% endif %}
|
|
>
|
|
<input name="description" type="text" value="{{todo.description}}">
|
|
<input name="due_date" type="date" value="{% if todo.due_date %}{{todo.due_date|date:"Y-m-d"}}{% endif %}">
|
|
<div>
|
|
<input class="action-button" type="submit" value="Save changes">
|
|
<a data-action="todo#cancel" href="">cancel</a>
|
|
</div>
|
|
</form>
|
|
</li> |