2021-08-09 01:40:47 +00:00
|
|
|
{% extends "snippets/create_status/layout.html" %}
|
|
|
|
{% load bookwyrm_tags %}
|
|
|
|
{% load i18n %}
|
|
|
|
{% load utilities %}
|
|
|
|
{% load status_display %}
|
|
|
|
|
|
|
|
{% comment %}
|
|
|
|
----- Variables
|
|
|
|
book: the Edition object this status is related to. Required unless the status is a reply
|
|
|
|
draft: the content of an existing Status object to be edited (used in delete and redraft)
|
|
|
|
uuid: a unique identifier used to make html "id" attributes unique and clarify javascript controls
|
|
|
|
{% endcomment %}
|
|
|
|
|
|
|
|
{% with type="comment" %}
|
|
|
|
{% trans "Some thoughts on the book" as placeholder %}
|
|
|
|
|
|
|
|
{% block post_content_additions %}
|
2021-10-15 21:43:02 +00:00
|
|
|
{% if not draft.reading_status %}
|
2021-08-09 01:40:47 +00:00
|
|
|
{# Supplemental fields #}
|
|
|
|
<div>
|
|
|
|
{% active_shelf book as active_shelf %}
|
|
|
|
{% if active_shelf.shelf.identifier == 'reading' and book.latest_readthrough %}
|
|
|
|
|
|
|
|
{% with readthrough=book.latest_readthrough %}
|
|
|
|
<div class="field">
|
|
|
|
<input type="hidden" name="id" value="{{ readthrough.id }}"/>
|
|
|
|
<label class="label" for="progress_{{ uuid }}">{% trans "Progress:" %}</label>
|
|
|
|
<div class="field has-addons mb-0">
|
|
|
|
<div class="control">
|
2021-09-05 23:00:40 +00:00
|
|
|
<input
|
|
|
|
aria-label="{% if draft.progress_mode == 'PG' or readthrough.progress_mode == 'PG' %}Current page{% else %}Percent read{% endif %}"
|
|
|
|
class="input"
|
|
|
|
type="number"
|
|
|
|
min="0"
|
|
|
|
name="progress"
|
|
|
|
size="3"
|
|
|
|
value="{% firstof draft.progress readthrough.progress '' %}"
|
|
|
|
id="progress_{{ uuid }}"
|
2021-10-14 23:53:46 +00:00
|
|
|
{% if not draft %}data-cache-draft="id_progress_comment_{{ book.id }}"{% endif %}
|
2021-09-05 23:00:40 +00:00
|
|
|
>
|
2021-08-09 01:40:47 +00:00
|
|
|
</div>
|
|
|
|
<div class="control">
|
|
|
|
<div class="select">
|
2021-09-09 02:30:24 +00:00
|
|
|
<select
|
|
|
|
name="progress_mode"
|
|
|
|
aria-label="Progress mode"
|
2021-10-14 23:53:46 +00:00
|
|
|
{% if not draft %}data-cache-draft="id_progress_mode_comment_{{ book.id }}"{% endif %}
|
2021-09-09 02:30:24 +00:00
|
|
|
>
|
2021-09-05 23:00:40 +00:00
|
|
|
<option
|
|
|
|
value="PG"
|
|
|
|
{% if draft.progress_mode == 'PG' or readthrough.progress_mode == 'PG' %}selected{% endif %}
|
|
|
|
>
|
|
|
|
{% trans "pages" %}
|
|
|
|
</option>
|
|
|
|
<option
|
|
|
|
value="PCT"
|
|
|
|
{% if draft.progress_mode == 'PCT' or readthrough.progress_mode == 'PCT' %}selected{% endif %}
|
|
|
|
>
|
|
|
|
{% trans "percent" %}
|
|
|
|
</option>
|
2021-08-09 01:40:47 +00:00
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% if readthrough.progress_mode == 'PG' and book.pages %}
|
|
|
|
<p class="help">{% blocktrans with pages=book.pages %}of {{ pages }} pages{% endblocktrans %}</p>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endwith %}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2021-10-15 21:43:02 +00:00
|
|
|
{% endif %}
|
2021-08-09 01:40:47 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% endwith %}
|