summaryrefslogtreecommitdiff
path: root/app/helpers/notes_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/notes_helper.rb')
-rw-r--r--app/helpers/notes_helper.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb
index 7ae104b8fd1..9ed38ba84b2 100644
--- a/app/helpers/notes_helper.rb
+++ b/app/helpers/notes_helper.rb
@@ -42,4 +42,23 @@ module NotesHelper
project_id: noteable.project.id,
}.to_json
end
+
+ def link_to_new_diff_note(line_code)
+ discussion_id = Note.build_discussion_id(
+ @comments_target[:noteable_type],
+ @comments_target[:noteable_id] || @comments_target[:commit_id],
+ line_code
+ )
+
+ data = {
+ noteable_type: @comments_target[:noteable_type],
+ noteable_id: @comments_target[:noteable_id],
+ commit_id: @comments_target[:commit_id],
+ line_code: line_code,
+ discussion_id: discussion_id
+ }
+
+ link_to "", "javascript:;", class: "add-diff-note js-add-diff-note-button",
+ data: data, title: "Add a comment to this line"
+ end
end