Commit 9159be3a50e3bc94f30f85d9640eeac212bf0948
1 parent
caeb65b1
Exists in
master
and in
4 other branches
Fix MR diff comments. Fix wiki comments loading error
Showing
5 changed files
with
11 additions
and
4 deletions
Show diff stats
app/assets/stylesheets/sections/notes.scss
| @@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
| 14 | border-top:1px solid #aaa; | 14 | border-top:1px solid #aaa; |
| 15 | } | 15 | } |
| 16 | #new-notes-list.reversed { | 16 | #new-notes-list.reversed { |
| 17 | - border-bottom:1px solid #aaa; | 17 | + border-bottom:1px solid #ccc; |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | .issue_notes, | 20 | .issue_notes, |
| @@ -227,7 +227,7 @@ td .line_note_link { | @@ -227,7 +227,7 @@ td .line_note_link { | ||
| 227 | } | 227 | } |
| 228 | } | 228 | } |
| 229 | 229 | ||
| 230 | -.note-text { | 230 | +.note-text { |
| 231 | border: 1px solid #aaa; | 231 | border: 1px solid #aaa; |
| 232 | box-shadow:none; | 232 | box-shadow:none; |
| 233 | } | 233 | } |
app/contexts/notes/load_context.rb
| @@ -20,7 +20,7 @@ module Notes | @@ -20,7 +20,7 @@ module Notes | ||
| 20 | # this is the only case, where the order is DESC | 20 | # this is the only case, where the order is DESC |
| 21 | project.common_notes.order("created_at DESC, id DESC").limit(50) | 21 | project.common_notes.order("created_at DESC, id DESC").limit(50) |
| 22 | when "wiki" | 22 | when "wiki" |
| 23 | - project.wikis.reverse.map {|w| w.notes.fresh }.flatten[0..20] | 23 | + project.wiki_notes.limit(20) |
| 24 | end | 24 | end |
| 25 | 25 | ||
| 26 | @notes = if after_id | 26 | @notes = if after_id |
app/models/project.rb
| @@ -171,6 +171,10 @@ class Project < ActiveRecord::Base | @@ -171,6 +171,10 @@ class Project < ActiveRecord::Base | ||
| 171 | end | 171 | end |
| 172 | end | 172 | end |
| 173 | 173 | ||
| 174 | + def wiki_notes | ||
| 175 | + Note.where(noteable_id: wikis.map(&:id), noteable_type: 'Wiki', project_id: self.id) | ||
| 176 | + end | ||
| 177 | + | ||
| 174 | def project_id | 178 | def project_id |
| 175 | self.id | 179 | self.id |
| 176 | end | 180 | end |
app/models/wiki.rb
app/views/merge_requests/diffs.html.haml