gitlab-org--gitlab-foss/app/views/projects/commits/_parallel_view.html.haml

27 lines
1.1 KiB
Text
Raw Normal View History

2013-11-27 03:00:14 -05:00
/ Side-by-side diff view
%div.text-file
%table
2014-09-06 14:11:28 -04:00
- parallel_diff(diff, index).each do |line|
- 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]
%tr.line_holder.parallel
- if type_left == 'match'
2014-09-08 03:04:56 -04:00
= render "projects/commits/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}"}
2014-09-06 14:11:28 -04:00
= link_to raw(line_number_left)
2014-09-08 03:04:56 -04:00
%td.line_content{class: "parallel noteable_line #{type_left}" }= raw line_content_left
%td.new_line{ class: "#{type_right == 'new' ? 'new' : nil}", data: { linenumber: line_number_right }}
2014-09-06 14:11:28 -04:00
= link_to raw(line_number_right)
%td.line_content.parallel{class: "noteable_line #{type_right == 'new' ? 'new' : nil}"}= raw line_content_right
2014-09-04 06:05:58 -04:00
- if diff.diff.blank? && diff_file_mode_changed?(diff)
.file-mode-changed
File mode changed