Commit da6ca7ab4802397fb12b6a5c75ba98a88a414c50
Exists in
master
and in
27 other branches
Merge branch 'AI2911-comment_order_improvements' into 'rails235'
Ai2911 Comment Order Improvements Corrections of https://gitlab.com/noosfero/noosfero/merge_requests/90 ActionItem: http://noosfero.org/Development/ActionItem2911 - Add an option to order comments by the newest or oldest comments.
Showing
1 changed file
with
10 additions
and
0 deletions
Show diff stats
app/views/content_viewer/view_page.rhtml
@@ -92,6 +92,16 @@ | @@ -92,6 +92,16 @@ | ||
92 | </div> | 92 | </div> |
93 | <% end %> | 93 | <% end %> |
94 | 94 | ||
95 | + <% if @page.accept_comments? and @comments.count > 1 %> | ||
96 | + <%= hidden_field_tag("page_url", url_for(:controller=>'content_viewer', :action=>'view_page', :profile=>profile.identifier)) %> | ||
97 | + <%= javascript_include_tag "comment_order.js" %> | ||
98 | + <div class="comment-order"> | ||
99 | + <% form_tag({:controller=>'content_viewer' , :action=>'view_page'}, {:method=>'get', :id=>"form_order"}) do %> | ||
100 | + <%= select_tag 'comment_order', options_for_select({_('Oldest first')=>'oldest', _('Newest first')=>'newest'}, @comment_order) %> | ||
101 | + <% end %> | ||
102 | + </div> | ||
103 | + <% end %> | ||
104 | + | ||
95 | <ul class="article-comments-list"> | 105 | <ul class="article-comments-list"> |
96 | <%= render :partial => 'comment/comment', :collection => @comments %> | 106 | <%= render :partial => 'comment/comment', :collection => @comments %> |
97 | <%= pagination_links @comments, :param_name => 'comment_page' %> | 107 | <%= pagination_links @comments, :param_name => 'comment_page' %> |