moviewyrm/bookwyrm/templates/snippets/rate_action.html

19 lines
842 B
HTML
Raw Normal View History

2020-12-13 02:25:04 +00:00
{% load bookwyrm_tags %}
{% if request.user.is_authenticated %}
2020-09-30 22:10:37 +00:00
<span class="is-sr-only">Leave a rating</span>
2020-09-28 22:57:31 +00:00
<div class="field is-grouped stars rate-stars">
2020-04-03 19:43:49 +00:00
{% for i in '12345'|make_list %}
<form name="rate" action="/rate/" method="POST">
2020-04-03 19:43:49 +00:00
{% csrf_token %}
2020-12-17 21:21:21 +00:00
<input type="hidden" name="user" value="{{ request.user.id }}">
2020-05-04 00:53:14 +00:00
<input type="hidden" name="book" value="{{ book.id }}">
2020-12-17 21:21:21 +00:00
<input type="hidden" name="privacy" value="public">
<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 %}">
2020-09-30 22:10:37 +00:00
<span class="is-sr-only">{{ forloop.counter }} star{{ forloop.counter | pluralize }}</span>
2020-04-03 19:43:49 +00:00
</button>
</form>
{% endfor %}
</div>
{% endif %}