2021-01-30 19:52:31 +00:00
{% load bookwyrm_tags %}
2021-02-28 02:48:10 +00:00
{% load i18n %}
2021-01-30 19:52:31 +00:00
{% for shelf in shelves %}
{% comparison_bool shelf.identifier active_shelf.shelf.identifier as is_current %}
{% if dropdown %}< li role = "menuitem" > {% endif %}
< div class = "{% if dropdown %}dropdown-item pt-0 pb-0{% elif active_shelf.shelf.identifier|next_shelf != shelf.identifier %}hidden{% endif %}" >
2021-01-30 23:46:20 +00:00
{% if shelf.identifier == 'reading' %}{% if not dropdown or active_shelf.shelf.identifier|next_shelf != shelf.identifier %}
2021-03-01 01:10:30 +00:00
{% trans "Start reading" as button_text %}
{% 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" disabled=is_current %}
2021-01-30 23:46:20 +00:00
{% endif %}{% elif shelf.identifier == 'read' and active_shelf.shelf.identifier == 'read' %}{% if not dropdown or active_shelf.shelf.identifier|next_shelf != shelf.identifier %}
2021-02-28 02:48:10 +00:00
< button type = "button" class = "button {{ class }}" disabled > < span > {% trans "Read" %}< / span >
2021-01-30 23:46:20 +00:00
{% endif %}{% elif shelf.identifier == 'read' %}{% if not dropdown or active_shelf.shelf.identifier|next_shelf != shelf.identifier %}
2021-03-01 01:10:30 +00:00
{% trans "Finish reading" as button_text %}
{% 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" disabled=is_current %}
2021-01-30 23:46:20 +00:00
{% endif %}{% elif shelf.identifier == 'to-read' %}{% if not dropdown or active_shelf.shelf.identifier|next_shelf != shelf.identifier %}
2021-03-01 01:10:30 +00:00
{% trans "Want to read" as button_text %}
{% 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" disabled=is_current %}
2021-01-30 23:46:20 +00:00
{% endif %}{% elif shelf.editable %}
2021-01-30 19:52:31 +00:00
< form name = "shelve" action = "/shelve/" method = "post" >
{% csrf_token %}
< input type = "hidden" name = "book" value = "{{ active_shelf.book.id }}" >
< button class = "button {{ class }}" name = "shelf" type = "submit" value = "{{ shelf.identifier }}" { % if shelf in book . shelf_set . all % } disabled { % endif % } >
< span > {{ shelf.name }}< / span >
< / button >
< / form >
{% endif %}
< / div >
{% if dropdown %}< / li > {% endif %}
{% endfor %}
2021-03-21 00:18:18 +00:00
{% if dropdown %}
2021-03-29 19:27:12 +00:00
{% if readthrough and active_shelf.shelf.identifier != 'read' %}
2021-03-21 00:18:18 +00:00
< li role = "menuitem" >
< div class = "dropdown-item pt-0 pb-0" >
{% trans "Update progress" as button_text %}
{% include 'snippets/toggle/toggle_button.html' with class=class text=button_text controls_text="progress-update" controls_uid=button_uuid focus="modal-title-progress-update" %}
< / div >
< / li >
{% endif %}
2021-03-29 19:27:12 +00:00
{% if active_shelf.shelf %}
< li role = "menuitem" >
< div class = "dropdown-item pt-0 pb-0" >
< form name = "shelve" action = "/unshelve/" method = "post" >
{% csrf_token %}
< input type = "hidden" name = "book" value = "{{ active_shelf.book.id }}" >
< input type = "hidden" name = "shelf" value = "{{ active_shelf.shelf.id }}" >
< button class = "button is-fullwidth is-small is-danger is-light" type = "submit" > {% trans "Unshelve" %}< / button >
< / form >
< / div >
< / li >
{% endif %}
{% endif %}