summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG1
-rw-r--r--app/views/projects/notes/discussions/_diff.html.haml15
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