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() ).exists()
) )
context["comment_list"] = queryset context["comment_list"] = queryset
context["comment_count"] = len(queryset)
context["vote_hide_threshold"] = settings.DMOJ_COMMENT_VOTE_HIDE_THRESHOLD context["vote_hide_threshold"] = settings.DMOJ_COMMENT_VOTE_HIDE_THRESHOLD
return context return context

View file

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