moviewyrm/bookwyrm/templates/snippets/readthrough_form.html
Mouse Reeve 21a954c7df Always use underscores in html ids
Plus some other shifting around
2021-08-08 19:44:12 -07:00

33 lines
1.6 KiB
HTML

{% load i18n %}
{% csrf_token %}
<input type="hidden" name="id" value="{{ readthrough.id }}">
<input type="hidden" name="book" value="{{ book.id }}">
<div class="field">
<label class="label" tabindex="0" id="add_readthrough_focus_{{ readthrough.id }}" for="id_start_date_{{ readthrough.id }}">
{% trans "Started reading" %}
</label>
<input type="date" name="start_date" class="input" id="id_start_date_{{ readthrough.id }}" value="{{ readthrough.start_date | date:"Y-m-d" }}">
</div>
{# Only show progress for editing existing readthroughs #}
{% if readthrough.id and not readthrough.finish_date %}
<label class="label" for="id_progress_{{ readthrough.id }}">
{% trans "Progress" %}
</label>
<div class="field has-addons">
<div class="control">
<input type="number" name="progress" class="input" id="id_progress_{{ readthrough.id }}" value="{{ readthrough.progress }}">
</div>
<div class="control select">
<select name="progress_mode" aria-label="Progress mode">
<option value="PG" {% if readthrough.progress_mode == 'PG' %}selected{% endif %}>{% trans "pages" %}</option>
<option value="PCT" {% if readthrough.progress_mode == 'PCT' %}selected{% endif %}>{% trans "percent" %}</option>
</select>
</div>
</div>
{% endif %}
<div class="field">
<label class="label" for="id_finish_date_{{ readthrough.id }}">
{% trans "Finished reading" %}
</label>
<input type="date" name="finish_date" class="input" id="id_finish_date_{{ readthrough.id }}" value="{{ readthrough.finish_date | date:"Y-m-d" }}">
</div>