2020-12-12 00:39:58 +00:00
|
|
|
{% load humanize %}
|
|
|
|
<div class="content block">
|
2021-01-07 02:34:21 +00:00
|
|
|
<input class="toggle-control" type="radio" name="show-edit-readthrough-{{ readthrough.id }}" id="show-readthrough-{{ readthrough.id }}" checked>
|
2020-12-12 00:39:58 +00:00
|
|
|
<div class="toggle-content hidden">
|
2021-01-07 02:34:21 +00:00
|
|
|
<dl class="mb-1">
|
2020-12-12 00:39:58 +00:00
|
|
|
{% if readthrough.start_date %}
|
2021-01-07 02:34:21 +00:00
|
|
|
<div class="is-flex">
|
|
|
|
<dt>Started reading:</dt>
|
|
|
|
<dd>{{ readthrough.start_date | naturalday }}</dd>
|
|
|
|
</div>
|
2020-12-12 00:39:58 +00:00
|
|
|
{% endif %}
|
|
|
|
{% if readthrough.finish_date %}
|
2021-01-07 02:34:21 +00:00
|
|
|
<div class="is-flex">
|
|
|
|
<dt>Finished reading:</dt>
|
|
|
|
<dd>{{ readthrough.finish_date | naturalday }}</dd>
|
|
|
|
</div>
|
2021-01-14 03:45:36 +00:00
|
|
|
{% elif readthrough.progress %}
|
|
|
|
<div class="is-flex">
|
|
|
|
<dt>Progress:</dt>
|
|
|
|
{% if readthrough.progress_mode == 'PG' %}
|
|
|
|
<dd>on page {{ readthrough.progress }} of {{ book.pages }}</dd>
|
|
|
|
{% else %}
|
|
|
|
<dd>{{ readthrough.progress }}%</dd>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2020-12-12 00:39:58 +00:00
|
|
|
{% endif %}
|
|
|
|
</dl>
|
|
|
|
<div class="field is-grouped">
|
|
|
|
<label class="button is-small" for="edit-readthrough-{{ readthrough.id }}" role="button" tabindex="0">
|
|
|
|
<span class="icon icon-pencil">
|
|
|
|
<span class="is-sr-only">Edit read-through dates</span>
|
|
|
|
</span>
|
|
|
|
</label>
|
|
|
|
<label class="button is-small" for="delete-readthrough-{{ readthrough.id }}" role="button" tabindex="0">
|
|
|
|
<span class="icon icon-x">
|
|
|
|
<span class="is-sr-only">Delete this read-through</span>
|
|
|
|
</span>
|
|
|
|
</label>
|
|
|
|
</div>
|
2021-01-14 03:45:36 +00:00
|
|
|
{% if show_progress %}
|
|
|
|
Progress Updates:
|
|
|
|
<ul>
|
|
|
|
{% if readthrough.finish_date %}
|
|
|
|
<li>{{ readthrough.start_date | naturalday }}: finished</li>
|
|
|
|
{% endif %}
|
|
|
|
{% for progress_update in readthrough.progress_updates %}
|
|
|
|
<li>
|
2021-01-17 10:28:37 +00:00
|
|
|
<form name="delete-update" action="/delete-progressupdate" method="POST">
|
|
|
|
{% csrf_token %}
|
|
|
|
{{ progress_update.created_date | naturalday }}:
|
|
|
|
{% if progress_update.mode == 'PG' %}
|
|
|
|
page {{ progress_update.progress }} of {{ book.pages }}
|
|
|
|
{% else %}
|
|
|
|
{{ progress_update.progress }}%
|
|
|
|
{% endif %}
|
|
|
|
<input type="hidden" name="id" value="{{ progress_update.id }}"/>
|
|
|
|
<button type="submit" class="button is-small" for="delete-progressupdate-{{ progress_update.id }}" role="button" tabindex="0">
|
|
|
|
<span class="icon icon-x">
|
|
|
|
<span class="is-sr-only">Delete this progress update</span>
|
|
|
|
</span>
|
|
|
|
</button>
|
|
|
|
</form>
|
2021-01-14 03:45:36 +00:00
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
<li>{{ readthrough.start_date | naturalday }}: started</li>
|
|
|
|
</ul>
|
|
|
|
{% elif readthrough.progress_updates|length %}
|
|
|
|
<a href="?showprogress">Show {{ readthrough.progress_updates|length }} Progress Updates</a>
|
|
|
|
{% endif %}
|
2020-12-12 00:39:58 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="block">
|
2021-01-07 02:34:21 +00:00
|
|
|
<input class="toggle-control" type="radio" name="show-edit-readthrough-{{ readthrough.id }}" id="edit-readthrough-{{ readthrough.id }}">
|
2020-12-12 00:39:58 +00:00
|
|
|
<div class="toggle-content hidden">
|
|
|
|
<div class="box">
|
|
|
|
<form name="edit-readthrough" action="/edit-readthrough" method="post">
|
2021-01-10 18:35:28 +00:00
|
|
|
{% include 'snippets/readthrough_form.html' with readthrough=readthrough %}
|
2020-12-12 00:39:58 +00:00
|
|
|
<div class="field is-grouped">
|
|
|
|
<button class="button is-primary" type="submit">Save</button>
|
|
|
|
<label class="button" for="show-readthrough-{{ readthrough.id }}" role="button" tabindex="0">Cancel</label>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<input class="toggle-control" type="checkbox" name="delete-readthrough-{{ readthrough.id }}" id="delete-readthrough-{{ readthrough.id }}">
|
|
|
|
<div class="modal toggle-content hidden">
|
|
|
|
<div class="modal-background"></div>
|
|
|
|
<div class="modal-card">
|
|
|
|
<header class="modal-card-head">
|
|
|
|
<p class="modal-card-title">Delete this read-though?</p>
|
|
|
|
<label class="delete" for="delete-readthrough-{{ readthrough.id }}" aria-label="close"></label>
|
|
|
|
</header>
|
|
|
|
<footer class="modal-card-foot">
|
|
|
|
<form name="delete-readthrough-{{ readthrough.id }}" action="/delete-readthrough" method="POST">
|
|
|
|
{% csrf_token %}
|
|
|
|
<input type="hidden" name="id" value="{{ readthrough.id }}">
|
|
|
|
<button class="button is-danger is-light" type="submit">
|
|
|
|
Delete
|
|
|
|
</button>
|
|
|
|
<label for="delete-readthrough-{{ readthrough.id }}" class="button" role="button" tabindex="0">Cancel</button>
|
|
|
|
</form>
|
|
|
|
</footer>
|
|
|
|
</div>
|
|
|
|
<label class="modal-close is-large" for="delete-readthrough-{{ readthrough.id }}" aria-label="close"></label>
|
|
|
|
</div>
|
|
|
|
</div>
|