2020-12-12 21:25:04 -05:00
|
|
|
{% load bookwyrm_tags %}
|
2020-09-30 18:10:37 -04:00
|
|
|
<span class="is-sr-only">Leave a rating</span>
|
2020-09-28 18:57:31 -04:00
|
|
|
<div class="field is-grouped stars rate-stars">
|
2020-04-03 15:43:49 -04:00
|
|
|
{% for i in '12345'|make_list %}
|
2020-04-04 13:08:34 -04:00
|
|
|
<form name="rate" action="/rate/" method="POST" onsubmit="return rate_stars(event)">
|
2020-04-03 15:43:49 -04:00
|
|
|
{% csrf_token %}
|
2020-12-17 16:21:21 -05:00
|
|
|
<input type="hidden" name="user" value="{{ request.user.id }}">
|
2020-05-03 20:53:14 -04:00
|
|
|
<input type="hidden" name="book" value="{{ book.id }}">
|
2020-12-17 16:21:21 -05:00
|
|
|
<input type="hidden" name="privacy" value="public">
|
2020-04-21 13:47:55 -04:00
|
|
|
<input type="hidden" name="rating" value="{{ forloop.counter }}">
|
2020-04-03 15:43:49 -04:00
|
|
|
<button type="submit" class="icon icon-star-{% if book|rating:user < forloop.counter %}empty{% else %}full{% endif %}">
|
2020-09-30 18:10:37 -04:00
|
|
|
<span class="is-sr-only">{{ forloop.counter }} star{{ forloop.counter | pluralize }}</span>
|
2020-04-03 15:43:49 -04:00
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|