fipamo/brain/views/dash/partials/options.twig
Zoë Bijl a687b50452 Fix for #109, add toggle state to buttons
Adds aria-pressed to the “Options” toggle buttons; this communicates their state to assistive technologies.
2023-07-25 12:51:26 +02:00

41 lines
1.5 KiB
Twig

{% if page['menu'] %}
{% set menu = 'true' %}
{% else %}
{% set menu = 'false' %}
{% endif %}
{% if page['featured'] %}
{% set featured = 'true' %}
{% else %}
{% set featured = 'false' %}
{% endif %}
{% if page['published'] %}
{% set published = 'true' %}
{% else %}
{% set published = 'false' %}
{% endif %}
<br>
<button id="option-menu-pin" class="option-inactive post-option-btn" aria-pressed="{{ menu }}" data-active="{{ menu }}" title='Pin to Menu'>
<svg id="option-page-icon" role="icon">
<use id="option-page-icon" xlink:href="/assets/images/global/sprite.svg#entypo-add-to-list"/>
</svg>
</button>
<button id="option-feature" class="option-inactive post-option-btn" aria-pressed="{{ featured }}" data-active="{{ featured }}" title='Feature'>
<svg id="option-feature-icon" role="icon">
<use id="option-feature-icon" xlink:href="/assets/images/global/sprite.svg#entypo-star"/>
</svg>
</button>
<button id="option-published" class="option-inactive post-option-btn" aria-pressed="{{ published }}" data-active="{{ published }}" title='Published'>
<svg id="option-published-icon" role="icon">
<use id="option-published-icon" xlink:href="/assets/images/global/sprite.svg#entypo-globe"/>
</svg>
</button>
<a href="/dashboard/page/preview/{{ uuid }}" target="_blank">
<button id="option-preview" class="option-inactive post-option-btn" data-active="false" title='preview page'>
<svg id="option-preview-icon" role="icon">
<use id="option-preview-icon" xlink:href="/assets/images/global/sprite.svg#entypo-eye"/>
</svg>
</button>
</a>