Commit 75b04a17 authored by Marin Jankovski's avatar Marin Jankovski

Take added or removed file into account.

parent 357bf009
...@@ -2,19 +2,24 @@ ...@@ -2,19 +2,24 @@
%div.text-file %div.text-file
%table %table
- side_diff_line(diff, index) do |line, type, line_code, line_new, line_old, raw_line, next_line| - side_diff_line(diff, index) do |line, type, line_code, line_new, line_old, raw_line, next_line|
- next if type == 'new'
%tr.line_holder.parallel{ id: line_code, class: "#{type}" } %tr.line_holder.parallel{ id: line_code, class: "#{type}" }
- if type == "match" - if type == "match"
= render "projects/commits/diffs/match_line_parallel", {line: line, = render "projects/commits/diffs/match_line_parallel", {line: line,
line_old: line_old, line_new: line_new, bottom: false} line_old: line_old, line_new: line_new, bottom: false}
- else - else
%td.old_line %td.old_line
- if diff.new_file
%td.line_content.parallel= " "
- else
= link_to raw(line_old), "##{line_code}", id: line_code = link_to raw(line_old), "##{line_code}", id: line_code
- if type == 'old' - if type == 'old'
%td.line_content{class: "parallel noteable_line old #{line_code}", "line_code" => line_code}= raw line %td.line_content{class: "parallel noteable_line old #{line_code}", "line_code" => line_code}= raw line
- else - else
%td.line_content.parallel= raw line %td.line_content.parallel= raw line
%td.new_line{data: {linenumber: line_new}} %td.new_line{data: {linenumber: line_new}}
- if diff.deleted_file
%td.line_content.parallel= " "
- else
= link_to raw(line_new) , "##{line_code}", id: line_code = link_to raw(line_new) , "##{line_code}", id: line_code
- if type == 'old' - if type == 'old'
%td.line_content.parallel{class: "noteable_line new #{line_code}", "line_code" => line_code}= raw next_line %td.line_content.parallel{class: "noteable_line new #{line_code}", "line_code" => line_code}= raw next_line
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment