2020-11-10 21:40:42 +00:00
|
|
|
<div class="dropdown">
|
|
|
|
<div class="dropdown-trigger">
|
|
|
|
<label for="shelf-select-dropdown-{{ book.id }}-toggle" role="button" aria-expanded="false" onclick="toggleMenu(this)" tabindex="0" aria-haspopup="true" aria-controls="shelf-select-{{ book.id }}">
|
|
|
|
<div class="button">
|
|
|
|
<span>Change shelf</span>
|
|
|
|
<span class="icon icon-arrow-down" aria-hidden="true"></span>
|
|
|
|
</div>
|
|
|
|
</label>
|
2020-11-07 19:49:57 +00:00
|
|
|
</div>
|
2020-11-10 21:40:42 +00:00
|
|
|
<input type="checkbox" class="toggle-control" id="shelf-select-dropdown-{{ book.id }}-toggle">
|
|
|
|
<div class="dropdown-menu toggle-content hidden" id="shelf-select-{{ book.id }}" role="menu">
|
2020-11-07 19:49:57 +00:00
|
|
|
<ul class="dropdown-content">
|
|
|
|
{% for shelf in request.user.shelf_set.all %}
|
|
|
|
{% if shelf.identifier != current.identifier %}
|
2020-11-17 00:34:26 +00:00
|
|
|
<li role="menuitem">
|
2020-11-07 19:49:57 +00:00
|
|
|
<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 }}">
|
2020-11-09 20:10:37 +00:00
|
|
|
<button class="button is-small is-danger is-light" type="submit">Unshelve</button>
|
2020-11-07 19:49:57 +00:00
|
|
|
</form>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|