summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandx <dmitriy.zaporozhets@gmail.com>2012-09-15 09:49:21 +0300
committerrandx <dmitriy.zaporozhets@gmail.com>2012-09-15 09:49:21 +0300
commit9159be3a50e3bc94f30f85d9640eeac212bf0948 (patch)
treeb032cb8db77add039debf05eb645630ba9f7ee1d
parentcaeb65b1892c8a140d8f72f6aafa3f5fd1d3cbc3 (diff)
downloadgitlab-ce-9159be3a50e3bc94f30f85d9640eeac212bf0948.tar.gz
Fix MR diff comments. Fix wiki comments loading error
-rw-r--r--app/assets/stylesheets/sections/notes.scss4
-rw-r--r--app/contexts/notes/load_context.rb2
-rw-r--r--app/models/project.rb4
-rw-r--r--app/models/wiki.rb1
-rw-r--r--app/views/merge_requests/diffs.html.haml4
5 files changed, 11 insertions, 4 deletions
diff --git a/app/assets/stylesheets/sections/notes.scss b/app/assets/stylesheets/sections/notes.scss
index 2db20f166a6..148807d6521 100644
--- a/app/assets/stylesheets/sections/notes.scss
+++ b/app/assets/stylesheets/sections/notes.scss
@@ -14,7 +14,7 @@
border-top:1px solid #aaa;
}
#new-notes-list.reversed {
- border-bottom:1px solid #aaa;
+ border-bottom:1px solid #ccc;
}
.issue_notes,
@@ -227,7 +227,7 @@ td .line_note_link {
}
}
-.note-text {
+.note-text {
border: 1px solid #aaa;
box-shadow:none;
}
diff --git a/app/contexts/notes/load_context.rb b/app/contexts/notes/load_context.rb
index 6d26e16a56c..f92a780187d 100644
--- a/app/contexts/notes/load_context.rb
+++ b/app/contexts/notes/load_context.rb
@@ -20,7 +20,7 @@ module Notes
# this is the only case, where the order is DESC
project.common_notes.order("created_at DESC, id DESC").limit(50)
when "wiki"
- project.wikis.reverse.map {|w| w.notes.fresh }.flatten[0..20]
+ project.wiki_notes.limit(20)
end
@notes = if after_id
diff --git a/app/models/project.rb b/app/models/project.rb
index 4de836c7b48..56d5d7910b9 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -171,6 +171,10 @@ class Project < ActiveRecord::Base
end
end
+ def wiki_notes
+ Note.where(noteable_id: wikis.map(&:id), noteable_type: 'Wiki', project_id: self.id)
+ end
+
def project_id
self.id
end
diff --git a/app/models/wiki.rb b/app/models/wiki.rb
index 3c4952cd291..ebb1ff49c7a 100644
--- a/app/models/wiki.rb
+++ b/app/models/wiki.rb
@@ -28,7 +28,6 @@ class Wiki < ActiveRecord::Base
end
new_wiki
end
-
end
end
# == Schema Information
diff --git a/app/views/merge_requests/diffs.html.haml b/app/views/merge_requests/diffs.html.haml
index 176b19bcbbb..a755491c42e 100644
--- a/app/views/merge_requests/diffs.html.haml
+++ b/app/views/merge_requests/diffs.html.haml
@@ -1,2 +1,6 @@
= render "show"
+:javascript
+ $(function(){
+ PerLineNotes.init();
+ });