forked from mirrors/bookwyrm
Fixes rate action
This commit is contained in:
parent
dccd9ac052
commit
5cadd48aef
2 changed files with 3 additions and 1 deletions
|
@ -53,7 +53,7 @@ class Comment(Note):
|
||||||
@dataclass(init=False)
|
@dataclass(init=False)
|
||||||
class Review(Comment):
|
class Review(Comment):
|
||||||
''' a full book review '''
|
''' a full book review '''
|
||||||
name: str
|
name: str = None
|
||||||
rating: int = None
|
rating: int = None
|
||||||
type: str = 'Review'
|
type: str = 'Review'
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,9 @@
|
||||||
{% for i in '12345'|make_list %}
|
{% for i in '12345'|make_list %}
|
||||||
<form name="rate" action="/rate/" method="POST" onsubmit="return rate_stars(event)">
|
<form name="rate" action="/rate/" method="POST" onsubmit="return rate_stars(event)">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
<input type="hidden" name="user" value="{{ request.user.id }}">
|
||||||
<input type="hidden" name="book" value="{{ book.id }}">
|
<input type="hidden" name="book" value="{{ book.id }}">
|
||||||
|
<input type="hidden" name="privacy" value="public">
|
||||||
<input type="hidden" name="rating" value="{{ forloop.counter }}">
|
<input type="hidden" name="rating" value="{{ forloop.counter }}">
|
||||||
<button type="submit" class="icon icon-star-{% if book|rating:user < forloop.counter %}empty{% else %}full{% endif %}">
|
<button type="submit" class="icon icon-star-{% if book|rating:user < forloop.counter %}empty{% else %}full{% endif %}">
|
||||||
<span class="is-sr-only">{{ forloop.counter }} star{{ forloop.counter | pluralize }}</span>
|
<span class="is-sr-only">{{ forloop.counter }} star{{ forloop.counter | pluralize }}</span>
|
||||||
|
|
Loading…
Reference in a new issue