summaryrefslogtreecommitdiff
path: root/app/views/projects/diffs/_parallel_view.html.haml
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-06-05 15:24:05 -0700
committerStan Hu <stanhu@gmail.com>2015-06-16 06:11:59 -0700
commita7932fe2fd63da4864afb01bff859f4e1fbe9576 (patch)
treecf217e07d0b4f468e0a3378407d7fddc29bd5310 /app/views/projects/diffs/_parallel_view.html.haml
parent903132bc079970787333347209f6baebdd48800f (diff)
downloadgitlab-ce-a7932fe2fd63da4864afb01bff859f4e1fbe9576.tar.gz
Support commenting on a diff in side-by-side view
Closes https://github.com/gitlabhq/gitlabhq/issues/9283
Diffstat (limited to 'app/views/projects/diffs/_parallel_view.html.haml')
-rw-r--r--app/views/projects/diffs/_parallel_view.html.haml6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/views/projects/diffs/_parallel_view.html.haml b/app/views/projects/diffs/_parallel_view.html.haml
index 75f3a80f0d7..cb41dd852d3 100644
--- a/app/views/projects/diffs/_parallel_view.html.haml
+++ b/app/views/projects/diffs/_parallel_view.html.haml
@@ -18,6 +18,8 @@
- elsif type_left == 'old' || type_left.nil?
%td.old_line{id: line_code_left, class: "#{type_left}"}
= link_to raw(line_number_left), "##{line_code_left}", id: line_code_left
+ - if @comments_allowed && can?(current_user, :write_note, @project)
+ = link_to_new_diff_note(line_code_left, 'old')
%td.line_content{class: "parallel noteable_line #{type_left} #{line_code_left}", "line_code" => line_code_left }= raw line_content_left
- if type_right == 'new'
@@ -29,12 +31,14 @@
%td.new_line{id: new_line_code, class: "#{new_line_class}", data: { linenumber: line_number_right }}
= link_to raw(line_number_right), "##{new_line_code}", id: new_line_code
+ - if @comments_allowed && can?(current_user, :write_note, @project)
+ = link_to_new_diff_note(line_code_right, 'new')
%td.line_content.parallel{class: "noteable_line #{new_line_class} #{new_line_code}", "line_code" => new_line_code}= raw line_content_right
- if @reply_allowed
- comments_left, comments_right = organize_comments(type_left, type_right, line_code_left, line_code_right)
- if comments_left.present? || comments_right.present?
- = render "projects/notes/diff_notes_with_reply_parallel", notes1: comments_left, notes2: comments_right
+ = render "projects/notes/diff_notes_with_reply_parallel", notes_left: comments_left, notes_right: comments_right
- if diff_file.diff.diff.blank? && diff_file.mode_changed?
.file-mode-changed