Changeset - 051624cb5f3a
[Not reviewed]
default
0 2 0
Thomas De Schampheleire - 11 years ago 2015-01-27 22:03:55
thomas.de_schampheleire@alcatel-lucent.com
comment handling: clarify shown comment count (inline vs general)

Instead of showing the number of comments as:
y comments (z inline)
show it as:
x comments (z inline, y general)
2 files changed with 11 insertions and 7 deletions:
0 comments (0 inline, 0 general)
kallithea/templates/changeset/changeset_file_comment.html
Show inline comments
 
@@ -108,10 +108,14 @@
 
</%def>
 

	
 

	
 
## show comment count
 
## show comment count as "x comments (y inline, z general)"
 
<%def name="comment_count(inline_cnt, general_cnt)">
 
${ungettext("%d comment", "%d comments", general_cnt) % general_cnt} ${ungettext("(%d inline)", "(%d inline)", inline_cnt) % inline_cnt}
 
<span class="firstlink"></span>
 
    ${'%s (%s, %s)' % (
 
        ungettext("%d comment", "%d comments", inline_cnt + general_cnt) % (inline_cnt + general_cnt),
 
        ungettext("%d inline", "%d inline", inline_cnt) % inline_cnt,
 
        ungettext("%d general", "%d general", general_cnt) % general_cnt
 
    )}
 
    <span class="firstlink"></span>
 
</%def>
 

	
 
## generates inlines taken from c.comments var
kallithea/tests/functional/test_changeset_comments.py
Show inline comments
 
@@ -43,7 +43,7 @@ class TestChangeSetCommentsController(Te
 
        self.assertEqual(ChangesetComment.query().count(), 1)
 
        response.mustcontain(
 
            '''<div class="comments-number">'''
 
            ''' 1 comment (0 inline)'''
 
            ''' 1 comment (0 inline, 1 general)'''
 
        )
 

	
 
        self.assertEqual(Notification.query().count(), 1)
 
@@ -80,7 +80,7 @@ class TestChangeSetCommentsController(Te
 
        self.assertEqual(ChangesetComment.query().count(), 1)
 
        response.mustcontain(
 
            '''<div class="comments-number">'''
 
            ''' 0 comments (1 inline)'''
 
            ''' 1 comment (1 inline, 0 general)'''
 
        )
 
        response.mustcontain(
 
            '''<div style="display:none" class="inline-comment-placeholder" '''
 
@@ -120,7 +120,7 @@ class TestChangeSetCommentsController(Te
 
        self.assertEqual(ChangesetComment.query().count(), 1)
 
        response.mustcontain(
 
            '''<div class="comments-number">'''
 
            ''' 1 comment (0 inline)'''
 
            ''' 1 comment (0 inline, 1 general)'''
 
        )
 

	
 
        self.assertEqual(Notification.query().count(), 2)
 
@@ -155,5 +155,5 @@ class TestChangeSetCommentsController(Te
 
                                repo_name=HG_REPO, revision=rev))
 
        response.mustcontain(
 
            '''<div class="comments-number">'''
 
            ''' 0 comments (0 inline)'''
 
            ''' 0 comments (0 inline, 0 general)'''
 
        )
0 comments (0 inline, 0 general)