diff --git a/judge/comments.py b/judge/comments.py index 5ce4fa7..d99f11e 100644 --- a/judge/comments.py +++ b/judge/comments.py @@ -184,5 +184,6 @@ class CommentedDetailView(TemplateResponseMixin, SingleObjectMixin, View): ).exists() ) context["comment_list"] = queryset + context["comment_count"] = len(queryset) context["vote_hide_threshold"] = settings.DMOJ_COMMENT_VOTE_HIDE_THRESHOLD return context diff --git a/templates/actionbar/list.html b/templates/actionbar/list.html index 0bb2ef1..0bad8e1 100644 --- a/templates/actionbar/list.html +++ b/templates/actionbar/list.html @@ -27,9 +27,9 @@ {{_("Comment")}} - {% if comment_list.count() %} + {% if comment_count %} - ({{comment_list.count()}}) + ({{comment_count}}) {% endif %}