Show current rating in interaction rating

This commit is contained in:
Mouse Reeve 2020-04-03 13:36:56 -07:00
parent a27effd05d
commit d91b77f49e
6 changed files with 5 additions and 9 deletions

View file

@ -333,9 +333,6 @@ button .icon {
margin: 0;
color: black;
}
.rate-stars form > .icon:before {
content: '\e9d7';
}
.rate-stars:hover .icon:before {
content: '\e9d9';
}

View file

@ -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>

View file

@ -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 %}

View file

@ -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 %}

View file

@ -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 %}

View file

@ -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)