2021-05-11 21:41:28 +00:00
|
|
|
{% load utilities %}
|
2022-01-18 19:20:27 +00:00
|
|
|
{% load shelf_tags %}
|
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 %}
|
2021-12-31 02:27:33 +00:00
|
|
|
{% join "start_reading" button_uuid as modal_id %}
|
|
|
|
{% include 'snippets/shelve_button/modal_button.html' with class=class 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 %}
|
2021-12-31 02:27:33 +00:00
|
|
|
{% join "finish_reading" button_uuid as modal_id %}
|
|
|
|
{% include 'snippets/shelve_button/modal_button.html' with class=class 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 %}
|
2021-12-31 02:27:33 +00:00
|
|
|
{% join "want_to_read" button_uuid as modal_id %}
|
|
|
|
{% include 'snippets/shelve_button/modal_button.html' with class=class 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 }}">
|
2022-01-18 18:22:20 +00:00
|
|
|
<button
|
|
|
|
class="button {{ class }}"
|
|
|
|
name="shelf"
|
|
|
|
type="submit"
|
|
|
|
value="{{ shelf.identifier }}"
|
|
|
|
{% if book|is_book_on_shelf:shelf %} disabled {% endif %}
|
|
|
|
>
|
2021-09-09 23:32:21 +00:00
|
|
|
<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 %}
|