2021-01-30 19:52:31 +00:00
|
|
|
{% load bookwyrm_tags %}
|
2021-05-11 21:41:28 +00:00
|
|
|
{% load utilities %}
|
2021-02-28 02:48:10 +00:00
|
|
|
{% load i18n %}
|
2021-05-11 21:41:28 +00:00
|
|
|
|
2021-09-09 22:36:58 +00:00
|
|
|
{% with next_shelf_identifier=active_shelf.shelf.identifier|next_shelf %}
|
2021-06-08 19:40:01 +00:00
|
|
|
|
2021-09-09 22:36:58 +00:00
|
|
|
<div
|
|
|
|
class="{% if next_shelf_identifier != 'complete' %}is-hidden{% endif %}"
|
|
|
|
data-shelf-identifier="complete"
|
|
|
|
>
|
2021-08-21 17:50:27 +00:00
|
|
|
<button type="button" class="button {{ class }}" disabled>
|
|
|
|
<span>{% trans "Read" %}</span>
|
|
|
|
</button>
|
2021-09-09 22:36:58 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
{% for shelf in shelves %}
|
2021-09-09 23:32:21 +00:00
|
|
|
<div
|
|
|
|
class="{% if next_shelf_identifier != shelf.identifier %}is-hidden{% endif %}"
|
|
|
|
data-shelf-identifier="{{ shelf.identifier }}"
|
|
|
|
data-shelf-next="{{ shelf.identifier|next_shelf }}"
|
|
|
|
>
|
|
|
|
{% if shelf.identifier == 'reading' %}
|
2021-09-09 22:36:58 +00:00
|
|
|
|
2021-09-09 23:32:21 +00:00
|
|
|
{% trans "Start reading" as button_text %}
|
|
|
|
{% url 'reading-status' 'start' book.id as fallback_url %}
|
|
|
|
{% include 'snippets/toggle/toggle_button.html' with class=class text=button_text controls_text="start_reading" controls_uid=button_uuid focus="modal_title_start_reading" fallback_url=fallback_url %}
|
2021-06-08 19:40:01 +00:00
|
|
|
|
2021-09-09 23:32:21 +00:00
|
|
|
{% elif shelf.identifier == 'read' %}
|
2021-06-08 19:40:01 +00:00
|
|
|
|
2021-09-09 23:32:21 +00:00
|
|
|
{% trans "Finish reading" as button_text %}
|
|
|
|
{% url 'reading-status' 'finish' book.id as fallback_url %}
|
|
|
|
{% include 'snippets/toggle/toggle_button.html' with class=class text=button_text controls_text="finish_reading" controls_uid=button_uuid focus="modal_title_finish_reading" fallback_url=fallback_url %}
|
2021-06-08 19:40:01 +00:00
|
|
|
|
2021-09-09 23:32:21 +00:00
|
|
|
{% elif shelf.identifier == 'to-read' %}
|
2021-06-08 19:40:01 +00:00
|
|
|
|
2021-09-09 23:32:21 +00:00
|
|
|
{% trans "Want to read" as button_text %}
|
|
|
|
{% url 'reading-status' 'want' book.id as fallback_url %}
|
|
|
|
{% include 'snippets/toggle/toggle_button.html' with class=class text=button_text controls_text="want_to_read" controls_uid=button_uuid focus="modal_title_want_to_read" fallback_url=fallback_url %}
|
2021-09-09 22:36:58 +00:00
|
|
|
|
2021-09-09 23:32:21 +00:00
|
|
|
{% elif shelf.editable %}
|
2021-09-09 22:36:58 +00:00
|
|
|
|
2021-12-29 19:31:26 +00:00
|
|
|
<form name="shelve-{{ uuid }}-{{ shelf.identifier }}" action="/shelve/" method="post">
|
2021-01-30 19:52:31 +00:00
|
|
|
{% csrf_token %}
|
|
|
|
<input type="hidden" name="book" value="{{ active_shelf.book.id }}">
|
2021-09-09 23:32:21 +00:00
|
|
|
<button class="button {{ class }}" name="shelf" type="submit" value="{{ shelf.identifier }}" {% if shelf in book.shelf_set.all %} disabled {% endif %}>
|
|
|
|
<span>{{ shelf.name }}</span>
|
2021-01-30 19:52:31 +00:00
|
|
|
</button>
|
|
|
|
</form>
|
2021-09-09 23:32:21 +00:00
|
|
|
|
2021-01-30 19:52:31 +00:00
|
|
|
{% endif %}
|
2021-09-09 23:32:21 +00:00
|
|
|
</div>
|
|
|
|
{% endfor %}
|
2021-03-29 19:27:12 +00:00
|
|
|
|
2021-09-09 22:36:58 +00:00
|
|
|
{% endwith %}
|