{% extends 'snippets/components/dropdown.html' %}
{% block dropdown-trigger %}
<span class="icon icon-arrow-down">
    <span class="is-sr-only">More shelves</span>
</span>
{% endblock %}

{% block dropdown-list %}
{% for shelf in request.user.shelf_set.all %}
<li role="menuitem">
    {% if active_shelf.shelf.identifier != 'reading' and shelf.identifier == 'reading' %}
    <div class="dropdown-item pt-0 pb-0">
        {% include 'snippets/toggle/toggle_button.html' with class="is-fullwidth is-small" text="Start reading" controls_text="start-reading" controls_uid=button_uuid focus="modal-title-start-reading" %}
    </div>
    {% else %}
    <form class="dropdown-item pt-0 pb-0" name="shelve" action="/shelve/" method="post">
        {% csrf_token %}
        <input type="hidden" name="book" value="{{ active_shelf.book.id }}">
        <button class="button is-fullwidth is-small" name="shelf" type="submit" value="{{ shelf.identifier }}" {% if shelf in book.shelf_set.all %} disabled {% endif %}>
            <span>{{ shelf.name }}</span>
            {% if shelf in book.shelf_set.all %}<span class="icon icon-check"></span>{% endif %}
        </button>
    </form>
    {% endif %}
</li>
{% endfor %}
{% endblock %}