2020-12-13 02:25:04 +00:00
|
|
|
{% load bookwyrm_tags %}
|
2021-01-05 00:50:58 +00:00
|
|
|
{% if request.user.is_authenticated %}
|
2020-09-30 22:10:37 +00:00
|
|
|
<span class="is-sr-only">Leave a rating</span>
|
2021-01-18 17:57:44 +00:00
|
|
|
<div class="block">
|
|
|
|
<form class="hidden-form" name="rate" action="/post/rating" 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">
|
2020-04-21 17:47:55 +00:00
|
|
|
<input type="hidden" name="rating" value="{{ forloop.counter }}">
|
2021-01-18 17:57:44 +00:00
|
|
|
|
|
|
|
<div class="field is-grouped stars form-rate-stars mb-1">
|
|
|
|
<label class="is-sr-only" for="no-rating-{{ book.id }}">No rating</label>
|
|
|
|
<input class="is-sr-only" type="radio" name="rating" value="" id="no-rating-{{ book.id }}" checked>
|
|
|
|
{% for i in '12345'|make_list %}
|
|
|
|
<input class="is-sr-only" id="book{{book.id}}-star-{{ forloop.counter }}" type="radio" name="rating" value="{{ forloop.counter }}" {% if book|rating:user == forloop.counter %}checked{% endif %}>
|
|
|
|
<label class="icon icon-star-empty" for="book{{book.id}}-star-{{ forloop.counter }}">
|
|
|
|
<span class="is-sr-only">{{ forloop.counter }} star{{ forloop.counter | pluralize }}</span>
|
|
|
|
</label>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="field has-addons hidden">
|
|
|
|
<div class="control">
|
|
|
|
{% include 'snippets/privacy_select.html' with class="is-small" %}
|
|
|
|
</div>
|
|
|
|
<div class="control">
|
|
|
|
<button class="button is-small is-primary" type="submit">Rate</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-04-03 19:43:49 +00:00
|
|
|
</form>
|
|
|
|
</div>
|
2021-01-05 00:50:58 +00:00
|
|
|
{% endif %}
|