summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-08-07 04:28:10 +0000
committerStan Hu <stanhu@gmail.com>2015-08-07 04:28:10 +0000
commita1e6fc157f70f1fe5e8d7b8cc9a34d1ff108b7d8 (patch)
treee91d4ccf592b4a5815e2f748f9565589ae1fcfc7
parent5fb5fd253a960ed33eebc0f6aabeae37aa175fa8 (diff)
parent3bd503836c838f53aae45b3402f99178bd8291ee (diff)
downloadgitlab-ce-a1e6fc157f70f1fe5e8d7b8cc9a34d1ff108b7d8.tar.gz
Merge branch 'issue-2216' into 'master'
Diff colors on MR Discussion like on Changes-tab Fixes #2216 # Before ![Screen_Shot_2015-08-06_at_21.44.58](https://gitlab.com/gert/gitlab-ce/uploads/ed5935e0713dd58f9cd4b17a1fecaa86/Screen_Shot_2015-08-06_at_21.44.58.png) # After ![Screen_Shot_2015-08-06_at_21.44.33](https://gitlab.com/gert/gitlab-ce/uploads/0816360afcc7cf860d2eadf8dd63b49e/Screen_Shot_2015-08-06_at_21.44.33.png) See merge request !1108
-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" ? "&nbsp;" : line.old_pos)
- %td.new_line{class: line.type == "new" ? "new" : "old"}
- = raw(line.type == "old" ? "&nbsp;" : 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" ? "&nbsp;" : line.old_pos)
+ %td.new_line
+ = raw(type == "old" ? "&nbsp;" : 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