X-Git-Url: https://git.openstreetmap.org/osqa.git/blobdiff_plain/e6a05ab54f6eea95902b7e9d12858de123e39d17..158a305095187b1b1c9cee417b94d15f515e5ebe:/forum/templatetags/node_tags.py diff --git a/forum/templatetags/node_tags.py b/forum/templatetags/node_tags.py index 5cdd3b0..69260c4 100644 --- a/forum/templatetags/node_tags.py +++ b/forum/templatetags/node_tags.py @@ -182,7 +182,8 @@ def post_controls(post, user): @register.inclusion_tag('node/comments.html') def comments(post, user): - all_comments = post.comments.filter_state(deleted=False).order_by('-added_at') + all_comments = post.comments.filter_state(deleted=False)\ + .order_by('-added_at' if settings.SHOW_LATEST_COMMENTS_FIRST else 'added_at') if len(all_comments) <= 5: top_scorers = all_comments @@ -233,6 +234,7 @@ def comments(post, user): 'showing': showing, 'total': total, 'more_comments_count' : int(total - showing), + 'show_latest_comments_first' : settings.SHOW_LATEST_COMMENTS_FIRST, 'user': user, }