2020-12-13 02:25:04 +00:00
{% load bookwyrm_tags %}
2020-03-27 15:10:04 +00:00
{% if request.user.is_authenticated %}
2020-02-22 00:26:52 +00:00
2020-11-17 00:34:26 +00:00
{% with book.id|uuid as uuid %}
2020-11-20 18:05:37 +00:00
{% active_shelf book as active_shelf %}
2021-01-17 18:40:40 +00:00
< div class = "field has-addons" >
< div class = "control" >
{% if switch_mode and active_shelf.book != book %}
{% include 'snippets/switch_edition_button.html' with edition=book size='is-small' %}
{% else %}
2020-12-16 22:45:35 +00:00
2021-01-17 18:40:40 +00:00
{% if active_shelf.shelf.identifier == 'read' %}
< button class = "button is-small" disabled >
< span > Read< / span > < span class = "icon icon-check" > < / span >
< / button >
{% elif active_shelf.shelf.identifier == 'reading' %}
2021-01-18 16:54:00 +00:00
{% include 'snippets/toggle/toggle_button.html' with class="is-small" text="I'm done!" controls_text="finish-reading" controls_uid=uuid focus="modal-title-finish-reading" %}
2021-01-17 18:40:40 +00:00
{% elif active_shelf.shelf.identifier == 'to-read' %}
2021-01-18 16:54:00 +00:00
{% include 'snippets/toggle/toggle_button.html' with class="is-small" text="Start reading" controls_text="start-reading" controls_uid=uuid focus="modal-title-start-reading" %}
2021-01-17 18:40:40 +00:00
{% else %}
< form name = "shelve" action = "/shelve/" method = "post" >
{% csrf_token %}
< input type = "hidden" name = "book" value = "{{ active_shelf.book.id }}" >
< input type = "hidden" name = "shelf" value = "to-read" >
< button class = "button is-small" type = "submit" > Want to read< / button >
< / form >
{% endif %}
< / div >
2021-01-18 00:48:05 +00:00
{% include 'snippets/shelve_button_dropdown.html' with class="is-small" button_uuid=uuid%}
2020-12-16 22:45:35 +00:00
{% endif %}
2020-11-06 00:48:15 +00:00
< / div >
2021-01-17 18:10:59 +00:00
{% include 'snippets/start_reading_modal.html' with book=active_shelf.book controls_text="start-reading" controls_uid=uuid %}
{% latest_read_through book request.user as readthrough %}
{% include 'snippets/finish_reading_modal.html' with book=active_shelf.book controls_text="finish-reading" controls_uid=uuid readthrough=readthrough %}
2020-11-17 00:34:26 +00:00
{% endwith %}
2020-03-27 15:10:04 +00:00
{% endif %}