moviewyrm/bookwyrm/templates/snippets/shelve_button.html
2020-09-30 15:10:37 -07:00

34 lines
1.3 KiB
HTML

{% load fr_display %}
{% if request.user.is_authenticated %}
<div class="field is-grouped">
<form name="shelve" action="/shelve/" method="post">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}">
<input type="hidden" name="shelf" value="{% shelve_button_identifier book %}">
<button class="button is-small" type="submit" style="">{% shelve_button_text book %}</button>
</form>
<div class="dropdown is-hoverable">
{% if not hide_pulldown %}
<div class="button dropdown-trigger is-small" >
<span class="icon icon-arrow-down"><span class="is-sr-only">More shelves</span></span>
</div>
<div class="dropdown-menu">
<ul class="dropdown-content">
<form class="dropdown-item" name="shelve" action="/shelve/" method="post">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}">
{% for shelf in request.user.shelf_set.all %}
<li>
<button class="is-small" name="shelf" type="submit" value="{{ shelf.identifier }}" {% if shelf in book.shelf_set.all %} disabled {% endif %}>{{ shelf.name }} {% if shelf in book.shelf_set.all %} ✓ {% endif %}</button>
</li>
{% endfor %}
</form>
</ul>
</div>
{% endif %}
</div>
</div>
{% endif %}