moviewyrm/bookwyrm/templates/snippets/toggle/toggle_button.html

33 lines
1.2 KiB
HTML
Raw Normal View History

2021-06-08 19:40:01 +00:00
{% if fallback_url %}
<form name="fallback-form-{{ controls_uuid}}" method="GET" action="{{ fallback_url }}">
{% endif %}
<button
2021-06-08 19:40:01 +00:00
{% if not fallback_url %}
type="button"
{% else %}
type="submit"
{% endif %}
2021-01-18 04:40:33 +00:00
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 %}"
2021-01-30 19:43:40 +00:00
{% if disabled %}disabled{% endif %}
>
2021-01-14 21:02:50 +00:00
{% if icon %}
2021-04-21 20:32:14 +00:00
<span class="icon icon-{{ icon }} m-0-mobile" title="{{ text }}">
2021-01-14 21:02:50 +00:00
<span class="is-sr-only">{{ text }}</span>
</span>
2021-04-21 15:35:55 +00:00
{% elif icon_with_text %}
2021-04-21 20:32:14 +00:00
<span class="icon icon-{{ icon_with_text }} m-0-mobile" title="{{ text }}"></span>
<span class="is-sr-only-mobile">{{ text }}</span>
2021-01-14 21:02:50 +00:00
{% else %}
2021-01-30 19:43:40 +00:00
<span>{{ text }}</span>
2021-01-14 21:02:50 +00:00
{% endif %}
</button>
2021-06-08 19:40:01 +00:00
{% if fallback_url %}
</form>
{% endif %}