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}"
|
2016-02-05 20:25:01 +05:30
|
|
|
.diff-content.code.js-syntax-highlight
|
2014-09-02 18:07:02 +05:30
|
|
|
%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"
|
2016-02-05 20:25:01 +05:30
|
|
|
%td.old_line.diff-line-num= "..."
|
|
|
|
%td.new_line.diff-line-num= "..."
|
|
|
|
%td.line_content.match= line.text
|
2014-09-02 18:07:02 +05:30
|
|
|
- else
|
2016-02-05 20:25:01 +05:30
|
|
|
%td.old_line.diff-line-num
|
2015-09-11 14:41:01 +05:30
|
|
|
= raw(type == "new" ? " " : line.old_pos)
|
2016-02-05 20:25:01 +05:30
|
|
|
%td.new_line.diff-line-num
|
2015-09-11 14:41:01 +05:30
|
|
|
= raw(type == "old" ? " " : line.new_pos)
|
2016-01-29 22:53:50 +05:30
|
|
|
%td.line_content{class: "noteable_line #{type} #{line_code}", line_code: line_code}= 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
|