Commit 299cd80bfff7b437b867b098558510a3e265bf02

Authored by Victor Costa
2 parents c8bfa35d 73ef1bd7

Merge branch 'AI3211-fix_comment_list' into rails3_stable

app/controllers/my_profile/cms_controller.rb
... ... @@ -232,7 +232,7 @@ class CmsController < MyProfileController
232 232 @current_category = Category.find(params[:category_id])
233 233 @categories = @current_category.children
234 234 end
235   - render :template => 'shared/update_categories', :locals => { :category => @current_category }
  235 + render :template => 'shared/update_categories', :locals => { :category => @current_category, :object_name => 'article' }
236 236 end
237 237  
238 238 def publish
... ...
app/controllers/my_profile/profile_editor_controller.rb
... ... @@ -54,7 +54,7 @@ class ProfileEditorController < MyProfileController
54 54 @current_category = Category.find(params[:category_id])
55 55 @categories = @current_category.children
56 56 end
57   - render :template => 'shared/update_categories', :locals => { :category => @current_category }
  57 + render :template => 'shared/update_categories', :locals => { :category => @current_category, :object_name => 'profile_data' }
58 58 end
59 59  
60 60 def header_footer
... ...
app/views/content_viewer/view_page.html.erb
... ... @@ -80,8 +80,8 @@
80 80 </h3>
81 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 86 <%= hidden_field_tag("page_url", url_for(:controller=>'content_viewer', :action=>'view_page', :profile=>profile.identifier, :page => @page.explode_path)) %>
87 87 <%= javascript_include_tag "comment_order.js" %>
... ... @@ -90,12 +90,14 @@
90 90 <%= select_tag 'comment_order', options_for_select({_('Oldest first')=>'oldest', _('Newest first')=>'newest'}, @comment_order) %>
91 91 <% end %>
92 92 </div>
  93 + <% end %>
93 94  
94   - <ul class="article-comments-list">
  95 + <ul class="article-comments-list">
  96 + <% if @comments.present? %>
95 97 <%= render :partial => 'comment/comment', :collection => @comments %>
96 98 <%= pagination_links @comments, :param_name => 'comment_page' %>
97   - </ul>
98   - <% end %>
  99 + <% end %>
  100 + </ul>
99 101  
100 102 <% if @page.accept_comments? %>
101 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>
... ...
app/views/shared/update_categories.js.erb
1 1 <%
2 2 content = render :partial => 'shared/select_categories',
3   - :locals => {:object_name => 'article', :multiple => true}, :layout => false
  3 + :locals => {:object_name => object_name, :multiple => true}, :layout => false
4 4 %>
5 5 jQuery('#select-categories').html('<%= j(content) %>');
... ...