moviewyrm/bookwyrm/templates/snippets/shelve_button.html

35 lines
1.3 KiB
HTML
Raw Normal View History

2020-02-21 23:39:25 +00:00
{% load fr_display %}
{% if request.user.is_authenticated %}
2020-09-29 00:25:26 +00:00
<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 %}">
2020-09-29 04:08:42 +00:00
<button class="button is-small" type="submit" style="">{% shelve_button_text book %}</button>
2020-09-29 00:25:26 +00:00
</form>
2020-09-28 22:57:31 +00:00
<div class="dropdown is-hoverable">
2020-09-29 00:25:26 +00:00
{% if not hide_pulldown %}
2020-09-29 04:08:42 +00:00
<div class="button dropdown-trigger is-small" >
2020-09-30 22:10:37 +00:00
<span class="icon icon-arrow-down"><span class="is-sr-only">More shelves</span></span>
2020-09-28 22:57:31 +00:00
</div>
<div class="dropdown-menu">
<ul class="dropdown-content">
2020-09-29 00:25:26 +00:00
<form class="dropdown-item" name="shelve" action="/shelve/" method="post">
2020-09-28 22:57:31 +00:00
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}">
{% for shelf in request.user.shelf_set.all %}
<li>
2020-09-29 04:08:42 +00:00
<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>
2020-09-28 22:57:31 +00:00
</li>
{% endfor %}
</form>
</ul>
</div>
{% endif %}
</div>
2020-02-21 23:39:25 +00:00
2020-09-29 00:25:26 +00:00
</div>
{% endif %}