diff options
author | Stan Hu <stanhu@gmail.com> | 2015-08-07 04:28:10 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-08-07 04:28:10 +0000 |
commit | a1e6fc157f70f1fe5e8d7b8cc9a34d1ff108b7d8 (patch) | |
tree | e91d4ccf592b4a5815e2f748f9565589ae1fcfc7 | |
parent | 5fb5fd253a960ed33eebc0f6aabeae37aa175fa8 (diff) | |
parent | 3bd503836c838f53aae45b3402f99178bd8291ee (diff) | |
download | gitlab-ce-a1e6fc157f70f1fe5e8d7b8cc9a34d1ff108b7d8.tar.gz |
Merge branch 'issue-2216' into 'master'
Diff colors on MR Discussion like on Changes-tab
Fixes #2216
# Before

# After

See merge request !1108
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/views/projects/notes/discussions/_diff.html.haml | 15 |
2 files changed, 9 insertions, 7 deletions
diff --git a/CHANGELOG b/CHANGELOG index a8b115519a8..97d8ef55628 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 7.14.0 (unreleased) + - Fix coloring of diffs on MR Discussion-tab (Gert Goet) - Fix "Network" and "Graphs" pages for branches with encoded slashes (Stan Hu) - Fix errors deleting and creating branches with encoded slashes (Stan Hu) - Always add current user to autocomplete controller to support filter by "Me" (Stan Hu) diff --git a/app/views/projects/notes/discussions/_diff.html.haml b/app/views/projects/notes/discussions/_diff.html.haml index 711aa39101b..0301445b5b2 100644 --- a/app/views/projects/notes/discussions/_diff.html.haml +++ b/app/views/projects/notes/discussions/_diff.html.haml @@ -12,18 +12,19 @@ .diff-content %table - note.truncated_diff_lines.each do |line| + - type = line.type - line_code = generate_line_code(note.file_path, line) - %tr.line_holder{ id: line_code } - - if line.type == "match" + %tr.line_holder{ id: line_code, class: "#{type}" } + - if type == "match" %td.old_line= "..." %td.new_line= "..." %td.line_content.matched= line.text - else - %td.old_line{class: line.type == "new" ? "new" : "old"} - = raw(line.type == "new" ? " " : line.old_pos) - %td.new_line{class: line.type == "new" ? "new" : "old"} - = raw(line.type == "old" ? " " : line.new_pos) - %td.line_content{class: "noteable_line #{line.type} #{line_code}", "line_code" => line_code}= raw diff_line_content(line.text) + %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) - if line_code == note.line_code = render "projects/notes/diff_notes_with_reply", notes: discussion_notes |