Merge pull request #112 from medialab-prado/98-sort-by-votes

Sort comments in sidebar by number of votes
This commit is contained in:
Fernando Blat
2017-02-09 14:40:27 +01:00
committed by GitHub

View File

@@ -6,7 +6,7 @@
<% end %> <% end %>
</div> </div>
<div class="comments-wrapper"> <div class="comments-wrapper">
<% annotation.comments.roots.sort_by_newest.limit(Legislation::Annotation::COMMENTS_PAGE_SIZE).each do |comment| %> <% annotation.comments.roots.sort_by_most_voted.limit(Legislation::Annotation::COMMENTS_PAGE_SIZE).each do |comment| %>
<div class="comment"> <div class="comment">
<div class="comment-text"> <div class="comment-text">
<p><%= truncate comment.body, length: 250 %></p> <p><%= truncate comment.body, length: 250 %></p>