Mercurial > kallithea
changeset 4818:051624cb5f3a
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)
author | Thomas De Schampheleire <thomas.de_schampheleire@alcatel-lucent.com> |
---|---|
date | Tue, 27 Jan 2015 22:03:55 +0100 |
parents | 0ee5a36aaa99 |
children | 990ec5ed4ee5 |
files | kallithea/templates/changeset/changeset_file_comment.html kallithea/tests/functional/test_changeset_comments.py |
diffstat | 2 files changed, 11 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/templates/changeset/changeset_file_comment.html Tue Jan 27 21:57:38 2015 +0100 +++ b/kallithea/templates/changeset/changeset_file_comment.html Tue Jan 27 22:03:55 2015 +0100 @@ -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
--- a/kallithea/tests/functional/test_changeset_comments.py Tue Jan 27 21:57:38 2015 +0100 +++ b/kallithea/tests/functional/test_changeset_comments.py Tue Jan 27 22:03:55 2015 +0100 @@ -43,7 +43,7 @@ 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 @@ 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 @@ 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 @@ repo_name=HG_REPO, revision=rev)) response.mustcontain( '''<div class="comments-number">''' - ''' 0 comments (0 inline)''' + ''' 0 comments (0 inline, 0 general)''' )