diff options
author | Dinesh Sawant <dineshsawant300@gmail.com> | 2017-02-07 20:49:11 +0530 |
---|---|---|
committer | Dinesh Sawant <dineshsawant300@gmail.com> | 2017-02-07 20:49:11 +0530 |
commit | 987162282c9d0e5cba7ab2b6f0a5603fe834c561 (patch) | |
tree | 0437a87732b87b79edaf028d58794958e2901768 /app/views/projects/diffs/_parallel_view.html.haml | |
parent | 1d57be4027e510bc04c320beb6050b9178f54a1f (diff) | |
parent | 412ab17d3f2033c6cc602c79be56476d186f124d (diff) | |
download | gitlab-ce-987162282c9d0e5cba7ab2b6f0a5603fe834c561.tar.gz |
Merge branch 'master' of https://gitlab.com/dinsaw/gitlab-ce into removed-unused-parameter-status-only
Diffstat (limited to 'app/views/projects/diffs/_parallel_view.html.haml')
-rw-r--r-- | app/views/projects/diffs/_parallel_view.html.haml | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/app/views/projects/diffs/_parallel_view.html.haml b/app/views/projects/diffs/_parallel_view.html.haml index f361204ecac..074f1f634ae 100644 --- a/app/views/projects/diffs/_parallel_view.html.haml +++ b/app/views/projects/diffs/_parallel_view.html.haml @@ -1,15 +1,17 @@ / Side-by-side diff view .text-file.diff-wrap-lines.code.js-syntax-highlight{ data: diff_view_data } %table - - last_line = 0 - diff_file.parallel_diff_lines.each do |line| - left = line[:left] - right = line[:right] - - last_line = right.new_pos if right %tr.line_holder.parallel - if left - - if left.meta? + - case left.type + - when 'match' = diff_match_line left.old_pos, nil, text: left.text, view: :parallel + - when 'nonewline' + %td.old_line.diff-line-num + %td.line_content.match= left.text - else - left_line_code = diff_file.line_code(left) - left_position = diff_file.position(left) @@ -21,8 +23,12 @@ %td.line_content.parallel - if right - - if right.meta? + - case right.type + - when 'match' = diff_match_line nil, right.new_pos, text: left.text, view: :parallel + - when 'nonewline' + %td.new_line.diff-line-num + %td.line_content.match= right.text - else - right_line_code = diff_file.line_code(right) - right_position = diff_file.position(right) @@ -37,5 +43,7 @@ - discussion_left, discussion_right = parallel_diff_discussions(left, right, diff_file) - if discussion_left || discussion_right = render "discussions/parallel_diff_discussion", discussion_left: discussion_left, discussion_right: discussion_right - - if !diff_file.new_file && last_line > 0 - = diff_match_line last_line, last_line, bottom: true, view: :parallel + - if !diff_file.new_file && diff_file.diff_lines.any? + - last_line = diff_file.diff_lines.last + %tr.line_holder.parallel + = diff_match_line last_line.old_pos, last_line.new_pos, bottom: true, view: :parallel |