Commit 9159be3a50e3bc94f30f85d9640eeac212bf0948

Authored by randx
1 parent caeb65b1

Fix MR diff comments. Fix wiki comments loading error

app/assets/stylesheets/sections/notes.scss
... ... @@ -14,7 +14,7 @@
14 14 border-top:1px solid #aaa;
15 15 }
16 16 #new-notes-list.reversed {
17   - border-bottom:1px solid #aaa;
  17 + border-bottom:1px solid #ccc;
18 18 }
19 19  
20 20 .issue_notes,
... ... @@ -227,7 +227,7 @@ td .line_note_link {
227 227 }
228 228 }
229 229  
230   -.note-text {
  230 +.note-text {
231 231 border: 1px solid #aaa;
232 232 box-shadow:none;
233 233 }
... ...
app/contexts/notes/load_context.rb
... ... @@ -20,7 +20,7 @@ module Notes
20 20 # this is the only case, where the order is DESC
21 21 project.common_notes.order("created_at DESC, id DESC").limit(50)
22 22 when "wiki"
23   - project.wikis.reverse.map {|w| w.notes.fresh }.flatten[0..20]
  23 + project.wiki_notes.limit(20)
24 24 end
25 25  
26 26 @notes = if after_id
... ...
app/models/project.rb
... ... @@ -171,6 +171,10 @@ class Project < ActiveRecord::Base
171 171 end
172 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 178 def project_id
175 179 self.id
176 180 end
... ...
app/models/wiki.rb
... ... @@ -28,7 +28,6 @@ class Wiki < ActiveRecord::Base
28 28 end
29 29 new_wiki
30 30 end
31   -
32 31 end
33 32 end
34 33 # == Schema Information
... ...
app/views/merge_requests/diffs.html.haml
1 1 = render "show"
2 2  
  3 +:javascript
  4 + $(function(){
  5 + PerLineNotes.init();
  6 + });
... ...