Skip to content

Commit

Permalink
Fix thread num replies
Browse files Browse the repository at this point in the history
  • Loading branch information
ffont committed Oct 15, 2024
1 parent a4f5163 commit f4e84af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions forum/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ def get_most_relevant_commenters_info_for_avatars(self):
}
return info_to_return

@property
def num_replies(self):
return self.num_posts - 1

class Meta:
ordering = ('-status', '-last_post__created')

Expand Down
2 changes: 1 addition & 1 deletion templates/forum/display_thread.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</div>
<div class="col-10 col-md-5">
<h6><a href="{% url "forums-thread" thread.forum.name_slug thread.id %}" {% if thread.status != 2 %}class="text-black"{% endif %}>{{ thread.title|safe }}</a></h6>
<p class="ellipsis">Started by <a href="{% url 'account' thread.author.username%}">{{ thread.author.username }}</a> {{thread.first_post.created|timesince}} ago · {{ thread.num_posts|bw_intcomma }} repl{{ thread.num_posts|pluralize:"y,ies" }}</p>
<p class="ellipsis">Started by <a href="{% url 'account' thread.author.username%}">{{ thread.author.username }}</a> {{thread.first_post.created|timesince}} ago · {{ thread.num_replies|bw_intcomma }} repl{{ thread.num_replies|pluralize:"y,ies" }}</p>
</div>
<div class="col-md-4 offset-md-2 d-none d-md-block">
{% cache 86400 bw_thread_common_commenters thread.id %}
Expand Down

0 comments on commit f4e84af

Please sign in to comment.