moviewyrm/bookwyrm/templates/snippets/shelf_selector.html
2020-11-07 11:49:57 -08:00

31 lines
1.3 KiB
HTML

<div class="dropdown is-hoverable">
<div class="dropdown-trigger button">
<p>Change shelf</p>
<span class="icon icon-arrow-down"></span>
</div>
<div class="dropdown-menu">
<ul class="dropdown-content">
{% for shelf in request.user.shelf_set.all %}
{% if shelf.identifier != current.identifier %}
<li>
<form class="dropdown-item pt-0 pb-0" name="shelve" action="/shelve/" method="post">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}">
<input type="hidden" name="shelf" value="{{ shelf.identifier }}">
<button class="button is-small" type="submit">{{ shelf.name }}</button>
</form>
</li>
{% endif %}
{% endfor %}
<hr class="navbar-divider">
<li>
<form class="dropdown-item pt-0 pb-0" name="shelve" action="/unshelve/" method="post">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}">
<input type="hidden" name="shelf" value="{{ current.id }}">
<button class="button is-small is-danger" type="submit">Unshelve</button>
</form>
</li>
</ul>
</div>
</div>