Fix rating on comments
This commit is contained in:
@@ -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 ():
|
||||
|
@@ -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 %}
|
||||
|
Reference in New Issue
Block a user