Fix rating on comments

This commit is contained in:
2016-11-01 19:28:46 +01:00
parent d36dcad773
commit 6faea83372
2 changed files with 2 additions and 1 deletions

View File

@@ -181,6 +181,7 @@ def comments_for_node(node_id):
some_comment['_user'] = subquery.get_user_info(some_comment['user'])
some_comment['_is_own'] = some_comment['user'] == current_user.objectid
some_comment['_current_user_rating'] = None # tri-state boolean
some_comment['_rating'] = some_comment.properties.rating_positive - some_comment.properties.rating_negative
if current_user.is_authenticated:
for rating in some_comment.properties.ratings or ():

View File

@@ -22,7 +22,7 @@
.comment-meta
.comment-rating(
class="{% if comment._current_user_rating is not none %}rated{% if comment._current_user_rating %} positive{% endif %}{% endif %}")
.comment-rating-value(title="Number of likes") {{ rating }}
.comment-rating-value(title="Number of likes") {{ comment._rating }}
| {% if not comment._is_own %}
.comment-action-rating.up(title="Like comment")
| {% endif %}