moviewyrm/bookwyrm/templates/snippets/rate_action.html
2021-10-14 15:56:34 -07:00

24 lines
1,021 B
HTML

{% load i18n %}
{% load bookwyrm_tags %}
{% if request.user.is_authenticated %}
<span class="is-sr-only">{% trans "Leave a rating" %}</span>
<div class="block">
<form class="hidden-form" name="rate" action="{% url 'create-status' 'rating' %}" method="POST">
{% csrf_token %}
<input type="hidden" name="user" value="{{ request.user.id }}">
<input type="hidden" name="book" value="{{ book.id }}">
<input type="hidden" name="privacy" value="public">
{% include 'snippets/form_rate_stars.html' with book=book classes='mb-1 has-text-warning-dark' default_rating=book|user_rating:request.user %}
<div class="field has-addons is-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">{% trans "Rate" %}</button>
</div>
</div>
</form>
</div>
{% endif %}