2013-11-27 08:00:14 +00:00
|
|
|
/ Side-by-side diff view
|
2016-01-07 02:01:44 +00:00
|
|
|
%div.text-file.diff-wrap-lines.code.file-content.js-syntax-highlight.white
|
2014-04-24 08:49:01 +00:00
|
|
|
%table
|
2014-09-08 13:26:49 +00:00
|
|
|
- parallel_diff(diff_file, index).each do |line|
|
2014-09-06 18:11:28 +00:00
|
|
|
- type_left = line[0]
|
|
|
|
- line_number_left = line[1]
|
|
|
|
- line_content_left = line[2]
|
2014-09-12 17:51:44 +00:00
|
|
|
- line_code_left = line[3]
|
2014-09-12 17:40:04 +00:00
|
|
|
- type_right = line[4]
|
|
|
|
- line_number_right = line[5]
|
|
|
|
- line_content_right = line[6]
|
|
|
|
- line_code_right = line[7]
|
2014-09-06 18:11:28 +00:00
|
|
|
|
2014-09-12 16:43:44 +00:00
|
|
|
%tr.line_holder.parallel
|
2014-09-06 18:11:28 +00:00
|
|
|
- if type_left == 'match'
|
2014-09-08 13:26:49 +00:00
|
|
|
= render "projects/diffs/match_line_parallel", { line: line_content_left,
|
2014-09-08 07:04:56 +00:00
|
|
|
line_old: line_number_left, line_new: line_number_right }
|
|
|
|
- elsif type_left == 'old' || type_left.nil?
|
2014-09-12 17:51:44 +00:00
|
|
|
%td.old_line{id: line_code_left, class: "#{type_left}"}
|
|
|
|
= link_to raw(line_number_left), "##{line_code_left}", id: line_code_left
|
2015-06-26 13:55:56 +00:00
|
|
|
- if @comments_allowed && can?(current_user, :create_note, @project)
|
2015-06-05 22:24:05 +00:00
|
|
|
= link_to_new_diff_note(line_code_left, 'old')
|
2016-01-07 00:54:36 +00:00
|
|
|
%td.line_content{class: "parallel noteable_line #{type_left} #{line_code_left}", "line_code" => line_code_left }= line_content_left.html_safe
|
2014-09-12 16:43:44 +00:00
|
|
|
|
|
|
|
- if type_right == 'new'
|
|
|
|
- new_line_class = 'new'
|
2014-09-12 17:40:04 +00:00
|
|
|
- new_line_code = line_code_right
|
2014-09-12 16:43:44 +00:00
|
|
|
- else
|
|
|
|
- new_line_class = nil
|
2014-09-12 17:51:44 +00:00
|
|
|
- new_line_code = line_code_left
|
2014-09-12 16:43:44 +00:00
|
|
|
|
|
|
|
%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
|
2015-06-26 13:55:56 +00:00
|
|
|
- if @comments_allowed && can?(current_user, :create_note, @project)
|
2015-06-05 22:24:05 +00:00
|
|
|
= link_to_new_diff_note(line_code_right, 'new')
|
2016-01-07 00:54:36 +00:00
|
|
|
%td.line_content.parallel{class: "noteable_line #{new_line_class} #{new_line_code}", "line_code" => new_line_code}= line_content_right.html_safe
|
2014-09-12 16:43:44 +00:00
|
|
|
|
|
|
|
- if @reply_allowed
|
2014-09-12 17:51:44 +00:00
|
|
|
- comments_left, comments_right = organize_comments(type_left, type_right, line_code_left, line_code_right)
|
|
|
|
- if comments_left.present? || comments_right.present?
|
2015-06-05 22:24:05 +00:00
|
|
|
= render "projects/notes/diff_notes_with_reply_parallel", notes_left: comments_left, notes_right: comments_right
|
2014-09-04 10:05:58 +00:00
|
|
|
|
2014-09-08 13:26:49 +00:00
|
|
|
- if diff_file.diff.diff.blank? && diff_file.mode_changed?
|
2014-09-04 10:05:58 +00:00
|
|
|
.file-mode-changed
|
|
|
|
File mode changed
|