Commit 76c221448be0aaa7d8e8a403bc122df66b0d77c3

Authored by Rodrigo Souto
2 parents 7b118e80 73ef1bd7

Merge branch 'AI3211-fix_comment_list' into 'master'

Ai3211 fix comment list

http://noosfero.org/Development/ActionItem3211

See merge request !260
Showing 1 changed file with 7 additions and 5 deletions   Show diff stats
app/views/content_viewer/view_page.html.erb
@@ -80,8 +80,8 @@ @@ -80,8 +80,8 @@
80 </h3> 80 </h3>
81 <% end %> 81 <% end %>
82 82
83 - <% if @page.accept_comments? && @comments.present? && @comments.count > 1 %>  
84 - <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form', :id => 'top-post-comment-button', :onclick => "jQuery('#page-comment-form .display-comment-form').first().click();") %> 83 + <% if @comments.present? && @comments.count > 1 %>
  84 + <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form', :id => 'top-post-comment-button', :onclick => "jQuery('#page-comment-form .display-comment-form').first().click();") if @page.accept_comments? %>
85 85
86 <%= hidden_field_tag("page_url", url_for(:controller=>'content_viewer', :action=>'view_page', :profile=>profile.identifier, :page => @page.explode_path)) %> 86 <%= hidden_field_tag("page_url", url_for(:controller=>'content_viewer', :action=>'view_page', :profile=>profile.identifier, :page => @page.explode_path)) %>
87 <%= javascript_include_tag "comment_order.js" %> 87 <%= javascript_include_tag "comment_order.js" %>
@@ -90,12 +90,14 @@ @@ -90,12 +90,14 @@
90 <%= select_tag 'comment_order', options_for_select({_('Oldest first')=>'oldest', _('Newest first')=>'newest'}, @comment_order) %> 90 <%= select_tag 'comment_order', options_for_select({_('Oldest first')=>'oldest', _('Newest first')=>'newest'}, @comment_order) %>
91 <% end %> 91 <% end %>
92 </div> 92 </div>
  93 + <% end %>
93 94
94 - <ul class="article-comments-list"> 95 + <ul class="article-comments-list">
  96 + <% if @comments.present? %>
95 <%= render :partial => 'comment/comment', :collection => @comments %> 97 <%= render :partial => 'comment/comment', :collection => @comments %>
96 <%= pagination_links @comments, :param_name => 'comment_page' %> 98 <%= pagination_links @comments, :param_name => 'comment_page' %>
97 - </ul>  
98 - <% end %> 99 + <% end %>
  100 + </ul>
99 101
100 <% if @page.accept_comments? %> 102 <% if @page.accept_comments? %>
101 <div id='page-comment-form' class='page-comment-form'><%= render :partial => 'comment/comment_form', :locals =>{:url => {:controller => :comment, :action => :create}, :display_link => true, :cancel_triggers_hide => true}%></div> 103 <div id='page-comment-form' class='page-comment-form'><%= render :partial => 'comment/comment_form', :locals =>{:url => {:controller => :comment, :action => :create}, :display_link => true, :cancel_triggers_hide => true}%></div>