moviewyrm/bookwyrm/templates/snippets/toggle/toggle_button.html
2021-04-21 17:35:55 +02:00

22 lines
969 B
HTML

<button
type="button"
class="{% if not nonbutton %}button {% endif %}{{ class }}{% if button_type %} {{ button_type }}{% endif %}"
data-controls="{{ controls_text }}{% if controls_uid %}-{{ controls_uid }}{% endif %}"
{% if focus %}data-focus-target="{{ focus }}{% if controls_uid %}-{{ controls_uid }}{% endif %}"{% endif %}
{% 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 %}
<span class="icon icon-{{ icon }}" title="{{ text }}">
<span class="is-sr-only">{{ text }}</span>
</span>
{% elif icon_with_text %}
<span class="icon icon-{{ icon_with_text }}" aria-hidden></span>
<span>{{ text }}</span>
{% else %}
<span>{{ text }}</span>
{% endif %}
</button>