summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-06-16 14:43:15 +0000
committerDouwe Maan <douwe@gitlab.com>2015-06-16 14:43:15 +0000
commitadffe47d3c1549bac13a15868a1fb8071bd0d10d (patch)
tree1c882406f0d55d99e4cb0a20988505212b751048 /app/helpers
parentbd6239f8cf75d110b3e53eabb9395f29cdff6a21 (diff)
parenta7932fe2fd63da4864afb01bff859f4e1fbe9576 (diff)
downloadgitlab-ce-adffe47d3c1549bac13a15868a1fb8071bd0d10d.tar.gz
Merge branch 'support-comment-parallel-diff' into 'master'
Support commenting on a diff in side-by-side view ### What does this MR do? This MR adds support for commenting on a diff in side-by-side (aka parallel) view. It also fixes a JavaScript bug (see !779) when the comment button is clicked on a line that already has a comment. There is an existing bug where the comment count is not updated when a new comment is added. I'll send a MR for that later. ### Why was this MR needed? Commenting only worked in "inline" mode. Often the side-by-side view is more conducive to writing comments. ### What are the relevant issue numbers? Closes https://github.com/gitlabhq/gitlabhq/issues/9283 ### Screenshot ![image](https://gitlab.com/stanhu/gitlab-ce/uploads/3d0a3213fde38844a681a826da18139b/image.png) See merge request !810
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/notes_helper.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb
index 271b53aa2b6..a7c1fa0b071 100644
--- a/app/helpers/notes_helper.rb
+++ b/app/helpers/notes_helper.rb
@@ -47,7 +47,7 @@ module NotesHelper
}.to_json
end
- def link_to_new_diff_note(line_code)
+ def link_to_new_diff_note(line_code, line_type = nil)
discussion_id = Note.build_discussion_id(
@comments_target[:noteable_type],
@comments_target[:noteable_id] || @comments_target[:commit_id],
@@ -59,7 +59,8 @@ module NotesHelper
noteable_id: @comments_target[:noteable_id],
commit_id: @comments_target[:commit_id],
line_code: line_code,
- discussion_id: discussion_id
+ discussion_id: discussion_id,
+ line_type: line_type
}
button_tag(class: 'btn add-diff-note js-add-diff-note-button',
@@ -69,7 +70,7 @@ module NotesHelper
end
end
- def link_to_reply_diff(note)
+ def link_to_reply_diff(note, line_type = nil)
return unless current_user
data = {
@@ -77,7 +78,8 @@ module NotesHelper
noteable_id: note.noteable_id,
commit_id: note.commit_id,
line_code: note.line_code,
- discussion_id: note.discussion_id
+ discussion_id: note.discussion_id,
+ line_type: line_type
}
button_tag class: 'btn reply-btn js-discussion-reply-button',