Skip to content

Commit

Permalink
Provide screen reader alternative to star rating: just the numeric level
Browse files Browse the repository at this point in the history
  • Loading branch information
thijskh authored and MKodde committed Feb 21, 2024
1 parent 629977c commit ca0536a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions templates/second_factor/loa-stars.html.twig
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{% set wholeStars = level|number_of_whole_stars %}
{% set halfStar = level|half_star %}
{% set remainingStars = 3 - wholeStars %}
<span class="loa-star-rating">
<span class="loa-star-rating" aria-label="{{ level }}">
{% if wholeStars > 0 %}
{% for star in 1..wholeStars %}
<img class="star" src="{{ asset('build/images/star.svg') }}">
<img class="star" src="{{ asset('build/images/star.svg') }}" alt="">
{% endfor %}
{% endif %}

{% if halfStar %}
<img class="star star-half" src="{{ asset('build/images/star-half.svg') }}">
<img class="star star-half" src="{{ asset('build/images/star-half.svg') }}" alt="">
{% set remainingStars = remainingStars - 1 %}
{% endif %}

{% if remainingStars > 0 %}
{% for star in 1..remainingStars %}
<img class="star star-open" src="{{ asset('build/images/star-open.svg') }}">
<img class="star star-open" src="{{ asset('build/images/star-open.svg') }}" alt="">
{% endfor %}
{% endif %}
</span>

0 comments on commit ca0536a

Please sign in to comment.