moviewyrm/bookwyrm/templates/snippets/stars.html

9 lines
408 B
HTML
Raw Normal View History

2020-04-03 19:43:49 +00:00
<div class="stars">
2020-11-10 05:15:55 +00:00
<span class="is-sr-only">{% if rating %}{{ rating|floatformat }} star{{ rating|floatformat | pluralize }}{% else %}No rating{% endif %}</span>
2020-04-03 19:43:49 +00:00
{% for i in '12345'|make_list %}
2020-04-03 20:58:14 +00:00
<span class="icon icon-star-{% if rating >= forloop.counter %}full{% elif rating|floatformat:0 >= forloop.counter|floatformat:0 %}half{% else %}empty{% endif %}">
2020-04-03 19:43:49 +00:00
</span>
{% endfor %}
</div>