moviewyrm/bookwyrm/templates/snippets/shelf_selector.html
Fabien Basmaison a05b14c338 [profile] Various HTML fixes:
- Wrap block level elements within block level elements, not inline.
- Avoid empty blocks.
- Change `<hr>` in lists into allowed type of children.
- Fix duplicated ID (some change that was not propagated across the template?).
- Make the anchor optional in the navbar (interactive elements (`a`, `input`, `button`…) should not appear into other interactive elements).
- Remove redundant `role` on main navigation.
- Make the modal a modal with `role="dialog".
- Use `button` instead of form-less `label`.
2021-03-03 20:10:09 +01:00

30 lines
1.2 KiB
HTML

{% extends 'components/dropdown.html' %}
{% load i18n %}
{% block dropdown-trigger %}
<span>{% trans "Change shelf" %}</span>
<span class="icon icon-arrow-down" aria-hidden="true"></span>
{% endblock %}
{% block dropdown-list %}
{% for shelf in request.user.shelf_set.all %}
{% if shelf.identifier != current.identifier %}
<li role="menuitem">
<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-fullwidth is-small" type="submit">{{ shelf.name }}</button>
</form>
</li>
{% endif %}
{% endfor %}
<li class="navbar-divider" role="presentation"></li>
<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-fullwidth is-small is-danger is-light" type="submit">{% trans "Unshelve" %}</button>
</form>
</li>
{% endblock %}