forked from mirrors/bookwyrm
55 lines
1.5 KiB
HTML
55 lines
1.5 KiB
HTML
|
{% spaceless %}
|
||
|
{% load i18n %}
|
||
|
{% load bookwyrm_tags %}
|
||
|
|
||
|
<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"
|
||
|
{% if book|user_rating:user == 0 %}checked{% endif %}
|
||
|
>
|
||
|
|
||
|
<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 }}"
|
||
|
{% if book|user_rating:user == forloop.counter %}checked{% endif %}
|
||
|
/>
|
||
|
|
||
|
<label
|
||
|
class="
|
||
|
icon
|
||
|
{% if forloop.counter <= book|user_rating:user %}
|
||
|
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 %}
|