diff --git a/kallithea/public/css/style.css b/kallithea/public/css/style.css
--- a/kallithea/public/css/style.css
+++ b/kallithea/public/css/style.css
@@ -4450,7 +4450,9 @@ div.rst-block pre {
margin: 0.5em 0px !important;
}
-.comments .comments-number {
+.comments .comments-number,
+.pr-comments-number {
+ margin: 5px;
padding: 0px 0px 10px 0px;
font-weight: bold;
color: #666;
@@ -5082,6 +5084,13 @@ div.comment:target>.comment-wrapp {
margin: -2px;
}
+div.prev-next-comment div.prev-comment,
+div.prev-next-comment div.next-comment {
+ display: inline-block;
+ min-width: 150px;
+ margin: 3px 6px;
+}
+
#help_kb {
display: none;
}
diff --git a/kallithea/public/js/base.js b/kallithea/public/js/base.js
--- a/kallithea/public/js/base.js
+++ b/kallithea/public/js/base.js
@@ -814,7 +814,9 @@ var _placeInline = function(target_id, l
$after_tr = $after_tr.next();
}
// put in the comment at the bottom
- $after_tr.after(_table_tr('inline-comments', html));
+ var $tr = _table_tr('inline-comments', html)
+ $tr.find('div.comment').addClass('inline-comment');
+ $after_tr.after($tr);
// scan nodes, and attach add button to last one
_placeAddButton($line_tr);
@@ -862,6 +864,36 @@ var renderInlineComments = function(file
}
}
+/**
+ * Double link comments
+ */
+var linkInlineComments = function(firstlinks, comments){
+ var $comments = $(comments);
+ if ($comments.length > 0) {
+ $(firstlinks).html('First comment'.format($comments.attr('id')));
+ }
+ if ($comments.length <= 1) {
+ return;
+ }
+
+ $comments.each(function(i, e){
+ var prev = '';
+ if (i > 0){
+ var prev_anchor = YUD.getAttribute(comments.item(i-1),'id');
+ prev = 'Previous comment'.format(prev_anchor);
+ }
+ var next = '';
+ if (i+1 < comments.length){
+ var next_anchor = YUD.getAttribute(comments.item(i+1),'id');
+ next = 'Next comment'.format(next_anchor);
+ }
+ var $div = $(('
-
+
@@ -197,6 +197,8 @@ ${self.repo_context_bar('changelog', c.c
var file_comments = YUQ('.inline-comment-placeholder');
renderInlineComments(file_comments);
+ linkInlineComments(document.getElementsByClassName('firstlink'), document.getElementsByClassName("inline-comment"));
+
pyroutes.register('changeset_home',
"${h.url('changeset_home', repo_name='%(repo_name)s', revision='%(revision)s')}",
['repo_name', 'revision']);
diff --git a/kallithea/templates/changeset/changeset_file_comment.html b/kallithea/templates/changeset/changeset_file_comment.html
--- a/kallithea/templates/changeset/changeset_file_comment.html
+++ b/kallithea/templates/changeset/changeset_file_comment.html
@@ -108,7 +108,7 @@
## generates inlines taken from c.comments var
<%def name="inlines()">
-
+
%for path, lines in c.inline_comments:
% for line,comments in lines.iteritems():
%endfor
+
% if c.limited_diff:
% endif
@@ -329,6 +330,8 @@ ${self.repo_context_bar('showpullrequest
var file_comments = YUQ('.inline-comment-placeholder');
renderInlineComments(file_comments);
+ linkInlineComments(document.getElementsByClassName('firstlink'), document.getElementsByClassName("inline-comment"));
+
YUE.on(YUD.get('update_pull_request'),'click',function(e){
updateReviewers(undefined, "${c.repo_name}", "${c.pull_request.pull_request_id}");
})
diff --git a/kallithea/tests/functional/test_changeset_comments.py b/kallithea/tests/functional/test_changeset_comments.py
--- a/kallithea/tests/functional/test_changeset_comments.py
+++ b/kallithea/tests/functional/test_changeset_comments.py
@@ -42,7 +42,7 @@ class TestChangeSetCommentsController(Te
# test DB
self.assertEqual(ChangesetComment.query().count(), 1)
response.mustcontain('''''' % 1)
+ '''(0 inline)''' % 1)
self.assertEqual(Notification.query().count(), 1)
self.assertEqual(ChangesetComment.query().count(), 1)
@@ -78,7 +78,7 @@ class TestChangeSetCommentsController(Te
self.assertEqual(ChangesetComment.query().count(), 1)
response.mustcontain(
'''''' % 1
+ ''' (%s inline)''' % 1
)
response.mustcontain(
'''''' % 1)
+ '''comment (0 inline)''' % 1)
self.assertEqual(Notification.query().count(), 2)
users = [x.user.username for x in UserNotification.query().all()]
@@ -150,4 +150,4 @@ class TestChangeSetCommentsController(Te
response = self.app.get(url(controller='changeset', action='index',
repo_name=HG_REPO, revision=rev))
response.mustcontain('''''')
+ ''' (0 inline)''')