diff --git a/pillar/web/nodes/custom/comments.py b/pillar/web/nodes/custom/comments.py index e04fdca2..c2c2861b 100644 --- a/pillar/web/nodes/custom/comments.py +++ b/pillar/web/nodes/custom/comments.py @@ -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 (): diff --git a/src/templates/nodes/custom/comment/_macros.jade b/src/templates/nodes/custom/comment/_macros.jade index 90cb26e5..8648c0c0 100644 --- a/src/templates/nodes/custom/comment/_macros.jade +++ b/src/templates/nodes/custom/comment/_macros.jade @@ -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 %}