Handle edit and delete readthroughs

This commit is contained in:
Mouse Reeve
2020-10-30 10:40:05 -07:00
parent 5641c36539
commit e39bf026cb
3 changed files with 55 additions and 7 deletions

View File

@ -73,7 +73,7 @@
</label>
<form name="delete-readthrough-{{ readthrough.id }}" action="/delete-readthrough" method="POST">
{% csrf_token %}
<input type="hidden" name="readthrough" value="{{ readthrough.id }}">
<input type="hidden" name="id" value="{{ readthrough.id }}">
<button class="button is-small" type="submit">
<span class="icon icon-x">
<span class="is-sr-only">Delete this readthrough</span>
@ -90,18 +90,16 @@
<form name="edit-readthrough" action="/edit-readthrough" method="post">
{% csrf_token %}
<input type="hidden" name="id" value="{{ readthrough.id }}">
<input type="hidden" name="user" value="{{ request.user.id }}">
<input type="hidden" name="book" value="{{ readthrough.book.id }}">
<div class="field">
<label class="label" for="start_date-{{ readthrough.id }}">
<label class="label" for="start_date">
Started reading
<input type="date" name="start_date-{{ readthrough.id }}" class="input" id="id_start_date-{{ readthrough.id }}" value="{{ readthrough.start_date | date:"Y-m-d" }}">
<input type="date" name="start_date" class="input" id="id_start_date-{{ readthrough.id }}" value="{{ readthrough.start_date | date:"Y-m-d" }}">
</label>
</div>
<div class="field">
<label class="label" for="finish_date-{{ readthrough.id }}">
<label class="label" for="finish_date">
Finished reading
<input type="date" name="finish_date-{{ readthrough.id }}" class="input" id="id_finish_date-{{ readthrough.id }}" value="{{ readthrough.finish_date | date:"Y-m-d" }}">
<input type="date" name="finish_date" class="input" id="id_finish_date-{{ readthrough.id }}" value="{{ readthrough.finish_date | date:"Y-m-d" }}">
</label>
</div>
<div class="field is-grouped">