moviewyrm/bookwyrm/templates/snippets/rate_action.html

26 lines
1,020 B
HTML
Raw Normal View History

2021-02-28 02:48:10 +00:00
{% load i18n %}
2022-01-18 20:07:46 +00:00
{% load rating_tags %}
{% if request.user.is_authenticated %}
2021-02-28 02:48:10 +00:00
<span class="is-sr-only">{% trans "Leave a rating" %}</span>
2021-01-18 17:57:44 +00:00
<div class="block">
<form class="hidden-form" name="rate" action="{% url 'create-status' '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">
2021-01-18 17:57:44 +00:00
{% include 'snippets/form_rate_stars.html' with book=book classes='mb-1 has-text-warning-dark' default_rating=book|user_rating:request.user %}
2021-01-18 17:57:44 +00:00
<div class="field has-addons is-hidden">
2021-01-18 17:57:44 +00:00
<div class="control">
{% include 'snippets/privacy_select.html' with class="is-small" %}
</div>
<div class="control">
2021-02-28 02:48:10 +00:00
<button class="button is-small is-primary" type="submit">{% trans "Rate" %}</button>
2021-01-18 17:57:44 +00:00
</div>
</div>
2020-04-03 19:43:49 +00:00
</form>
</div>
{% endif %}