bookwyrm/fedireads/templates/snippets/rate_action.html

15 lines
677 B
HTML
Raw Normal View History

2020-04-03 19:43:49 +00:00
{% load fr_display %}
<span class="hidden-text">Leave a rating</span>
<div class="stars rate-stars">
{% for i in '12345'|make_list %}
2020-04-04 17:08:34 +00:00
<form name="rate" action="/rate/" method="POST" onsubmit="return rate_stars(event)">
2020-04-03 19:43:49 +00:00
{% csrf_token %}
2020-05-04 00:53:14 +00:00
<input type="hidden" name="book" value="{{ book.id }}">
<input type="hidden" name="rating" value="{{ forloop.counter }}">
2020-04-03 19:43:49 +00:00
<button type="submit" class="icon icon-star-{% if book|rating:user < forloop.counter %}empty{% else %}full{% endif %}">
<span class="hidden-text">{{ forloop.counter }} star{{ forloop.counter | pluralize }}</span>
</button>
</form>
{% endfor %}
</div>