Optimize actionbar comment

This commit is contained in:
cuom1999 2023-03-07 23:43:26 -06:00
parent d2f261acfe
commit 9b5f0c0969
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -27,9 +27,9 @@
<span class="actionbar-text">
{{_("Comment")}}
</span>
{% if comment_list.count() %}
{% if comment_count %}
<span style="margin-left: 0.2em">
({{comment_list.count()}})
({{comment_count}})
</span>
{% endif %}
</span>