Commit a15c90a3 authored by Pierre-Yves Chibon's avatar Pierre-Yves Chibon

Hide the notifications when showing the number of comments on a ticket

parent c077f3f0
......@@ -616,6 +616,12 @@ class Issue(BASE):
''' Return the list of issue this issue blocks on in simple text. '''
return [issue.id for issue in self.parents]
@property
def user_comments(self):
''' Return user comments only, filter it from notifications
'''
return [comment for comment in self.comments if not comment.notification]
def to_json(self, public=False, with_comments=True):
''' Returns a dictionary representation of the issue.
......
......@@ -125,11 +125,11 @@
{{ issue.title | noJS("img") | safe }}
</a>
&nbsp;&nbsp;
{% if issue.comments|count > 0 %}
{% if issue.user_comments|count > 0 %}
<span class="text-muted">
<span class="oi" data-glyph="comment-square"
title="Comments on the ticket"></span>
{{issue.comments|count}}
{{issue.user_comments|count}}
</span>
{% endif %}
{% for tag in issue.tags%}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment