Menu list for shelf button options
This commit is contained in:
@ -10,22 +10,7 @@
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="control">
|
||||
{% if active_shelf.shelf.identifier == 'read' %}
|
||||
<button class="button is-small" disabled>
|
||||
<span>Read</span> <span class="icon icon-check"></span>
|
||||
</button>
|
||||
{% elif active_shelf.shelf.identifier == 'reading' %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with class="is-small" text="I'm done!" controls_text="finish-reading" controls_uid=uuid focus="modal-title-finish-reading" %}
|
||||
{% elif active_shelf.shelf.identifier == 'to-read' %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with class="is-small" text="Start reading" controls_text="start-reading" controls_uid=uuid focus="modal-title-start-reading" %}
|
||||
{% else %}
|
||||
<form name="shelve" action="/shelve/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ active_shelf.book.id }}">
|
||||
<input type="hidden" name="shelf" value="to-read">
|
||||
<button class="button is-small" type="submit">Want to read</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% include 'snippets/shelve_button_options.html' with class="shelf-option is-small" shelves=request.user.shelf_set.all active_shelf=active_shelf %}
|
||||
</div>
|
||||
{% include 'snippets/shelve_button_dropdown.html' with class="is-small" button_uuid=uuid%}
|
||||
{% endif %}
|
||||
|
@ -6,23 +6,5 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block dropdown-list %}
|
||||
{% for shelf in request.user.shelf_set.all %}
|
||||
<li role="menuitem">
|
||||
{% if active_shelf.shelf.identifier != 'reading' and shelf.identifier == 'reading' %}
|
||||
<div class="dropdown-item pt-0 pb-0">
|
||||
{% include 'snippets/toggle/toggle_button.html' with class="is-fullwidth is-small" text="Start reading" controls_text="start-reading" controls_uid=button_uuid focus="modal-title-start-reading" %}
|
||||
</div>
|
||||
{% else %}
|
||||
<form class="dropdown-item pt-0 pb-0" name="shelve" action="/shelve/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ active_shelf.book.id }}">
|
||||
<button class="button is-fullwidth is-small" name="shelf" type="submit" value="{{ shelf.identifier }}" {% if shelf in book.shelf_set.all %} disabled {% endif %}>
|
||||
<span>{{ shelf.name }}</span>
|
||||
{% if shelf in book.shelf_set.all %}<span class="icon icon-check"></span>{% endif %}
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% include 'snippets/shelve_button_options.html' with active_shelf=active_shelf shelves=request.user.shelf_set.all dropdown=True class="shelf-option is-fullwidth is-small" %}
|
||||
{% endblock %}
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
{% if checkbox %}data-controls-checkbox="{{ checkbox }}{% if controls_uid %}-{{ controls_uid }}{% endif %}"{% endif %}
|
||||
{% if label %}aria-label="{{ label }}"{% endif %}
|
||||
aria-pressed="{% if pressed %}true{% else %}false{% endif %}"
|
||||
{% if disabled %}disabled{% endif %}
|
||||
>
|
||||
|
||||
{% if icon %}
|
||||
@ -13,6 +14,6 @@
|
||||
<span class="is-sr-only">{{ text }}</span>
|
||||
</span>
|
||||
{% else %}
|
||||
{{ text }}
|
||||
<span>{{ text }}</span>
|
||||
{% endif %}
|
||||
</button>
|
||||
|
Reference in New Issue
Block a user