2021-01-29 11:51:36 -05:00
{% extends 'components/dropdown.html' %}
2021-02-27 21:48:10 -05:00
{% load i18n %}
2021-11-15 04:59:22 -05:00
{% load bookwyrm_tags %}
2021-11-19 16:06:13 -05:00
{% load utilities %}
2021-11-15 04:59:22 -05:00
2021-01-17 14:09:49 -05:00
{% block dropdown-trigger %}
2021-03-31 12:22:23 -04:00
< span > {% trans "Move book" %}< / span >
2021-01-17 14:09:49 -05:00
< span class = "icon icon-arrow-down" aria-hidden = "true" > < / span >
{% endblock %}
{% block dropdown-list %}
2021-11-19 16:06:13 -05:00
{% with book.id|uuid as uuid %}
{% active_shelf book as active_shelf %}
2021-05-22 20:58:08 -04:00
{% for shelf in user_shelves %}
2021-11-19 16:06:13 -05:00
2021-11-16 03:26:49 -05:00
{% if shelf.editable %}
2021-04-21 13:35:50 -04:00
< li role = "menuitem" class = "dropdown-item p-0" >
< form name = "shelve" action = "/shelve/" method = "post" >
2021-01-17 14:09:49 -05:00
{% csrf_token %}
< input type = "hidden" name = "book" value = "{{ book.id }}" >
2021-03-31 18:00:49 -04:00
< input type = "hidden" name = "change-shelf-from" value = "{{ current.identifier }}" >
2021-01-17 14:09:49 -05:00
< input type = "hidden" name = "shelf" value = "{{ shelf.identifier }}" >
2021-11-19 16:18:43 -05:00
< button class = "button is-fullwidth is-small shelf-option is-radiusless is-white" type = "submit" { % if shelf in book . shelf_set . all % } disabled { % endif % } > < span > {{ shelf.name }}< / span > < / button >
2021-01-17 14:09:49 -05:00
< / form >
< / li >
2021-11-19 16:06:13 -05:00
{% else%}
2021-11-19 16:18:43 -05:00
{% comparison_bool shelf.identifier active_shelf.shelf.identifier as is_current %}
2021-11-19 16:06:13 -05:00
{% with button_class="is-fullwidth is-small shelf-option is-radiusless is-white" %}
< li role = "menuitem" class = "dropdown-item p-0" >
{% if shelf.identifier == 'reading' %}
{% trans "Start reading" as button_text %}
{% url 'reading-status' 'start' book.id as fallback_url %}
{% include 'snippets/toggle/toggle_button.html' with class=button_class text=button_text controls_text="start_reading" controls_uid=uuid focus="modal_title_start_reading" disabled=is_current fallback_url=fallback_url %}
{% elif shelf.identifier == 'read' %}
{% trans "Read" as button_text %}
{% url 'reading-status' 'finish' book.id as fallback_url %}
{% include 'snippets/toggle/toggle_button.html' with class=button_class text=button_text controls_text="finish_reading" controls_uid=uuid focus="modal_title_finish_reading" disabled=is_current fallback_url=fallback_url %}
{% elif shelf.identifier == 'to-read' %}
{% trans "Want to read" as button_text %}
{% url 'reading-status' 'want' book.id as fallback_url %}
{% include 'snippets/toggle/toggle_button.html' with class=button_class text=button_text controls_text="want_to_read" controls_uid=uuid focus="modal_title_want_to_read" disabled=is_current fallback_url=fallback_url %}
{% endif %}
< / li >
{% endwith %}
2021-11-15 04:59:22 -05:00
{% endif %}
2021-01-17 14:09:49 -05:00
{% endfor %}
2021-04-21 13:35:50 -04:00
< li class = "navbar-divider" role = "separator" > < / li >
< li role = "menuitem" class = "dropdown-item p-0" >
< form name = "shelve" action = "/unshelve/" method = "post" >
2021-01-17 14:09:49 -05:00
{% csrf_token %}
< input type = "hidden" name = "book" value = "{{ book.id }}" >
< input type = "hidden" name = "shelf" value = "{{ current.id }}" >
2021-04-21 13:36:11 -04:00
< button class = "button is-fullwidth is-small is-radiusless is-danger is-light" type = "submit" > {% trans "Remove" %}< / button >
2021-01-17 14:09:49 -05:00
< / form >
< / li >
2021-11-19 16:06:13 -05:00
{% include 'snippets/reading_modals/want_to_read_modal.html' with book=active_shelf.book controls_text="want_to_read" controls_uid=uuid move_from=current.id %}
{% include 'snippets/reading_modals/start_reading_modal.html' with book=active_shelf.book controls_text="start_reading" controls_uid=uuid move_from=current.id %}
{% include 'snippets/reading_modals/finish_reading_modal.html' with book=active_shelf.book controls_text="finish_reading" controls_uid=uuid move_from=current.id readthrough=readthrough %}
{% include 'snippets/reading_modals/progress_update_modal.html' with book=active_shelf.book controls_text="progress_update" controls_uid=uuid move_from=current.id readthrough=readthrough %}
{% endwith %}
2021-01-17 14:09:49 -05:00
{% endblock %}