moviewyrm/bookwyrm/templates/snippets/readthrough.html

71 lines
4.3 KiB
HTML
Raw Normal View History

2021-02-28 02:48:10 +00:00
{% load i18n %}
{% load humanize %}
<div class="content block">
2021-01-17 18:10:59 +00:00
<div id="hide-edit-readthrough-{{ readthrough.id }}">
<div class="columns">
<div class="column">
2021-02-28 02:48:10 +00:00
{% trans "Progress Updates:" %}
</dl>
<ul>
{% if readthrough.finish_date or readthrough.progress %}
2021-02-28 02:48:10 +00:00
<li>{% if readthrough.finish_date %} {{ readthrough.finish_date | naturalday }}: {% trans "finished" %} {% else %}{% if readthrough.progress_mode == 'PG' %}on page {{ readthrough.progress }}{% if book.pages %} of {{ book.pages }}{% endif %}
2021-01-22 20:54:25 +00:00
{% else %}{{ readthrough.progress }}%{% endif %}{% endif %}
{% if readthrough.progress %}
{% trans "Show all updates" as button_text %}
{% include 'snippets/toggle/toggle_button.html' with text=button_text controls_text="updates" controls_uid=readthrough.id class="is-small" %}
<ul id="updates-{{ readthrough.id }}" class="hidden">
{% for progress_update in readthrough.progress_updates %}
<li>
<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" title="Delete this progress update">
2021-02-28 02:48:10 +00:00
<span class="is-sr-only">{% trans "Delete this progress update" %}</span>
</span>
</button>
</form>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endif %}
2021-02-28 02:48:10 +00:00
<li>{{ readthrough.start_date | naturalday }}: {% trans "started" %}</li>
</ul>
2021-01-17 18:10:59 +00:00
</div>
<div class="column is-narrow">
<div class="field has-addons">
<div class="control">
{% trans "Edit read dates" as button_text %}
{% include 'snippets/toggle/toggle_button.html' with class="is-small" text=button_text icon="pencil" controls_text="edit-readthrough" controls_uid=readthrough.id focus="edit-readthrough" %}
</div>
<div class="control">
{% trans "Delete these read dates" as button_text %}
{% include 'snippets/toggle/toggle_button.html' with class="is-small" text=button_text icon="x" controls_text="delete-readthrough" controls_uid=readthrough.id focus="modal-title-delete-readthrough" %}
</div>
</div>
2021-01-17 18:10:59 +00:00
</div>
</div>
</div>
</div>
<div class="box hidden" id="edit-readthrough-{{ readthrough.id }}" tabindex="0">
2021-02-28 02:48:10 +00:00
<h3 class="title is-5">{% trans "Edit read dates" %}</h3>
2021-01-17 18:10:59 +00:00
<form name="edit-readthrough" action="/edit-readthrough" method="post">
{% include 'snippets/readthrough_form.html' with readthrough=readthrough %}
<div class="field is-grouped">
2021-02-28 02:48:10 +00:00
<button class="button is-primary" type="submit">{% trans "Save" %}</button>
{% trans "Cancel" as button_text %}
{% include 'snippets/toggle/close_button.html' with text=button_text controls_text="edit-readthrough" controls_uid=readthrough.id %}
</div>
2021-01-17 18:10:59 +00:00
</form>
</div>
2021-01-17 18:10:59 +00:00
{% include 'snippets/delete_readthrough_modal.html' with controls_text="delete-readthrough" controls_uid=readthrough.id %}