moviewyrm/fedireads/templates/snippets/shelve_button.html

28 lines
919 B
HTML
Raw Normal View History

2020-02-21 23:39:25 +00:00
{% load fr_display %}
{% if not pulldown %}
<form name="shelve" action="/shelve/" method="post">
2020-02-21 23:39:25 +00:00
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}"></input>
<input type="hidden" name="shelf" value="{% shelve_button_identifier book %}"></input>
2020-03-15 21:15:36 +00:00
<button class="secondary" type="submit">{% shelve_button_text book %}</button>
2020-02-21 23:39:25 +00:00
</form>
{% else %}
<form name="shelve" action="/shelve/" method="post">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}"></input>
<select name="shelf">
{% for shelf in request.user.shelf_set.all %}
<option value="{{ shelf.identifier }}" {% if book in shelf.books.all %} selected {% endif %}>
{{ shelf.name }}{% if book in shelf.books.all %} ✓ {% endif %}
</option>
{% endfor %}
</select>
2020-03-15 21:15:36 +00:00
<button class="secondary" type="submit">Shelve</button>
</form>
{% endif %}