summaryrefslogtreecommitdiff
path: root/app/views/projects/diffs
diff options
context:
space:
mode:
authorMarin Jankovski <marin@gitlab.com>2014-09-09 11:36:29 +0200
committerMarin Jankovski <marin@gitlab.com>2014-09-09 11:36:29 +0200
commitac6a107ac7d7350d1df46d84bf831ab3d8bcc91a (patch)
tree0f75486277c99eed54fbf63ad510f60ae9fdf0c8 /app/views/projects/diffs
parent9c3935c5b0b6feddf91fd2170b50e5910b2cc932 (diff)
downloadgitlab-ce-ac6a107ac7d7350d1df46d84bf831ab3d8bcc91a.tar.gz
Add line code to parallel diff for linking.
Diffstat (limited to 'app/views/projects/diffs')
-rw-r--r--app/views/projects/diffs/_parallel_view.html.haml17
1 files changed, 9 insertions, 8 deletions
diff --git a/app/views/projects/diffs/_parallel_view.html.haml b/app/views/projects/diffs/_parallel_view.html.haml
index e7c0a5a8e58..47fe77ccf75 100644
--- a/app/views/projects/diffs/_parallel_view.html.haml
+++ b/app/views/projects/diffs/_parallel_view.html.haml
@@ -5,21 +5,22 @@
- type_left = line[0]
- line_number_left = line[1]
- line_content_left = line[2]
- - type_right = line[3]
- - line_number_right = line[4]
- - line_content_right = line[5]
+ - line_code = line[3]
+ - type_right = line[4]
+ - line_number_right = line[5]
+ - line_content_right = line[6]
- %tr.line_holder.parallel
+ %tr.line_holder.parallel{id: line_code}
- if type_left == 'match'
= render "projects/diffs/match_line_parallel", { line: line_content_left,
line_old: line_number_left, line_new: line_number_right }
- elsif type_left == 'old' || type_left.nil?
%td.old_line{class: "#{type_left}"}
- = link_to raw(line_number_left)
- %td.line_content{class: "parallel noteable_line #{type_left}" }= raw line_content_left
+ = link_to raw(line_number_left), "##{line_code}", id: line_code
+ %td.line_content{class: "parallel noteable_line #{type_left} #{line_code}", "line_code" => line_code }= raw line_content_left
%td.new_line{ class: "#{type_right == 'new' ? 'new' : nil}", data: { linenumber: line_number_right }}
- = link_to raw(line_number_right)
- %td.line_content.parallel{class: "noteable_line #{type_right == 'new' ? 'new' : nil}"}= raw line_content_right
+ = link_to raw(line_number_right), "##{line_code}", id: line_code
+ %td.line_content.parallel{class: "noteable_line #{type_right == 'new' ? 'new' : nil} #{line_code}", "line_code" => line_code}= raw line_content_right
- if diff_file.diff.diff.blank? && diff_file.mode_changed?
.file-mode-changed