2021-04-04 13:08:42 +00:00
|
|
|
{% spaceless %}
|
|
|
|
{% load i18n %}
|
|
|
|
|
|
|
|
<div class="
|
|
|
|
field is-grouped
|
|
|
|
stars form-rate-stars
|
|
|
|
{% if classes %}{{classes}}{% endif%}
|
|
|
|
">
|
|
|
|
<input
|
|
|
|
id="{{ type|slugify }}-{{ book.id }}-no-rating"
|
|
|
|
class="is-sr-only"
|
|
|
|
type="radio"
|
|
|
|
name="rating"
|
|
|
|
value="0"
|
2021-04-04 16:05:21 +00:00
|
|
|
{% if default_rating == 0 or not default_rating %}checked{% endif %}
|
2021-04-04 13:08:42 +00:00
|
|
|
>
|
|
|
|
|
|
|
|
<label class="is-sr-only" for="{{ type|slugify }}-{{ book.id }}-no-rating">
|
|
|
|
{% trans "No rating" %}
|
|
|
|
</label>
|
|
|
|
|
|
|
|
{% for i in '12345'|make_list %}
|
|
|
|
<input
|
|
|
|
id="{{ type|slugify }}-book{{ book.id }}-star-{{ forloop.counter }}"
|
|
|
|
class="is-sr-only"
|
|
|
|
type="radio"
|
|
|
|
name="rating"
|
|
|
|
value="{{ forloop.counter }}"
|
2021-04-04 16:05:21 +00:00
|
|
|
{% if default_rating == forloop.counter %}checked{% endif %}
|
2021-04-04 13:08:42 +00:00
|
|
|
/>
|
|
|
|
|
|
|
|
<label
|
|
|
|
class="
|
|
|
|
icon
|
2021-04-04 16:05:21 +00:00
|
|
|
{% if forloop.counter <= default_rating %}
|
2021-04-04 13:08:42 +00:00
|
|
|
icon-star-full
|
|
|
|
{% else %}
|
|
|
|
icon-star-empty
|
|
|
|
{% endif %}
|
|
|
|
"
|
|
|
|
for="{{ type|slugify }}-book{{ book.id }}-star-{{ forloop.counter }}"
|
|
|
|
>
|
|
|
|
<span class="is-sr-only">
|
|
|
|
{% blocktranslate trimmed count rating=forloop.counter %}
|
|
|
|
{{ rating }} star
|
|
|
|
{% plural %}
|
|
|
|
{{ rating }} stars
|
|
|
|
{% endblocktranslate %}
|
|
|
|
</span>
|
|
|
|
</label>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% endspaceless %}
|