moviewyrm/bookwyrm/templates/snippets/stars.html

28 lines
812 B
HTML
Raw Normal View History

{% spaceless %}
2021-02-28 02:48:10 +00:00
{% load i18n %}
2021-04-20 18:06:14 +00:00
<span class="stars">
<span class="is-sr-only">
{% if rating %}
{% blocktranslate trimmed with rating=rating|floatformat:0 count counter=rating|floatformat:0|add:0 %}
{{ rating }} star
{% plural %}
{{ rating }} stars
{% endblocktranslate %}
{% else %}
{% trans "No rating" %}
{% endif %}
2020-04-03 19:43:49 +00:00
</span>
{% for i in '12345'|make_list %}
<span
class="
icon is-small mr-1
icon-star-{% if rating >= forloop.counter %}full{% elif rating|floatformat:0 >= forloop.counter|floatformat:0 %}half{% else %}empty{% endif %}
"
aria-hidden="true"
></span>
2020-04-03 19:43:49 +00:00
{% endfor %}
2021-04-20 18:06:14 +00:00
</span>
{% endspaceless %}