2014-09-02 18:07:02 +05:30
|
|
|
- diff = note.diff
|
|
|
|
- if diff
|
|
|
|
.diff-file
|
|
|
|
.diff-header
|
2015-04-26 12:48:37 +05:30
|
|
|
%span
|
|
|
|
- if diff.deleted_file
|
|
|
|
= diff.old_path
|
|
|
|
- else
|
|
|
|
= diff.new_path
|
|
|
|
- if diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode
|
|
|
|
%span.file-mode= "#{diff.a_mode} → #{diff.b_mode}"
|
2014-09-02 18:07:02 +05:30
|
|
|
.diff-content
|
|
|
|
%table
|
2015-04-26 12:48:37 +05:30
|
|
|
- note.truncated_diff_lines.each do |line|
|
2015-09-11 14:41:01 +05:30
|
|
|
- type = line.type
|
2015-04-26 12:48:37 +05:30
|
|
|
- line_code = generate_line_code(note.file_path, line)
|
2015-09-11 14:41:01 +05:30
|
|
|
%tr.line_holder{ id: line_code, class: "#{type}" }
|
|
|
|
- if type == "match"
|
2014-09-02 18:07:02 +05:30
|
|
|
%td.old_line= "..."
|
|
|
|
%td.new_line= "..."
|
2015-04-26 12:48:37 +05:30
|
|
|
%td.line_content.matched= line.text
|
2014-09-02 18:07:02 +05:30
|
|
|
- else
|
2015-09-11 14:41:01 +05:30
|
|
|
%td.old_line
|
|
|
|
= raw(type == "new" ? " " : line.old_pos)
|
|
|
|
%td.new_line
|
|
|
|
= raw(type == "old" ? " " : line.new_pos)
|
|
|
|
%td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw diff_line_content(line.text)
|
2014-09-02 18:07:02 +05:30
|
|
|
|
|
|
|
- if line_code == note.line_code
|
|
|
|
= render "projects/notes/diff_notes_with_reply", notes: discussion_notes
|