forked from mirrors/bookwyrm
Show current rating in interaction rating
This commit is contained in:
parent
a27effd05d
commit
d91b77f49e
6 changed files with 5 additions and 9 deletions
|
@ -333,9 +333,6 @@ button .icon {
|
|||
margin: 0;
|
||||
color: black;
|
||||
}
|
||||
.rate-stars form > .icon:before {
|
||||
content: '\e9d7';
|
||||
}
|
||||
.rate-stars:hover .icon:before {
|
||||
content: '\e9d9';
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
</td>
|
||||
{% if ratings %}
|
||||
<td>
|
||||
{{ ratings | dict_key:book.id | stars}}
|
||||
{% include 'snippets/stars.html' with rating=ratings|dict_key:book.id %}
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<span class="hidden-text">Leave a rating</span>
|
||||
<div class="stars">
|
||||
{% for i in '12345'|make_list %}
|
||||
<span class="icon icon-star-{% if rating < forloop.counter %}empty{% else %}full{% endif %}">
|
||||
<span class="icon icon-star-{% if rating < forloop.counter %}empty{% elif rating|floatformat < forloop.counter %}half{% else %}full{% endif %}">
|
||||
<span class="hidden-text">{{ forloop.counter }} star{{ forloop.counter | pluralize }}</span>
|
||||
</span>
|
||||
{% endfor %}
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
{% if status.status_type == 'Review' %}
|
||||
<h3>
|
||||
{{ status.name }}<br>
|
||||
{{ status.rating | stars }}
|
||||
{% include 'snippets/stars.html' with rating=status.rating %}
|
||||
</h3>
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
{% elif status.status_type == 'Review' and not status.name and not status.content%}
|
||||
rated <a href="{{ status.book.absolute_id }}">{{ status.book.title }}</a>
|
||||
{% elif status.status_type == 'Review' %}
|
||||
reviewed {{ status.book.title }}
|
||||
reviewed <a href="{{ status.book.absolute_id }}">{{ status.book.title }}</a>
|
||||
{% elif status.status_type == 'Comment' %}
|
||||
commented on {{ status.book.title }}
|
||||
commented on <a href="{{ status.book.absolute_id }}">{{ status.book.title }}</a>
|
||||
{% elif status.status_type == 'Boost' %}
|
||||
boosted
|
||||
{% elif status.reply_parent %}
|
||||
|
|
|
@ -192,7 +192,6 @@ def rate(request):
|
|||
form = forms.RatingForm(request.POST)
|
||||
book_identifier = request.POST.get('book')
|
||||
# TODO: better failure behavior
|
||||
import pdb;pdb.set_trace()
|
||||
if not form.is_valid():
|
||||
return redirect('/book/%s' % book_identifier)
|
||||
|
||||
|
|
Loading…
Reference in a new issue