Commit 0f84eba86fb2d9056c4d663e587f78b5e892c8bc

Authored by Francisco Júnior
1 parent 9e4f2aa4

comment_paragraph: remove pagination support

plugins/comment_paragraph/controllers/profile/comment_paragraph_plugin_profile_controller.rb
@@ -4,13 +4,10 @@ class CommentParagraphPluginProfileController < ProfileController @@ -4,13 +4,10 @@ class CommentParagraphPluginProfileController < ProfileController
4 def view_comments 4 def view_comments
5 @article_id = params[:article_id] 5 @article_id = params[:article_id]
6 @paragraph_id = params[:paragraph_id] 6 @paragraph_id = params[:paragraph_id]
7 -  
8 article = profile.articles.find(@article_id) 7 article = profile.articles.find(@article_id)
9 - @paragraph_comment_page = (params[:paragraph_comment_page] || 1).to_i  
10 -  
11 @comments = article.comments.without_spam.in_paragraph(@paragraph_id) 8 @comments = article.comments.without_spam.in_paragraph(@paragraph_id)
12 @comments_count = @comments.count 9 @comments_count = @comments.count
13 @comments = @comments.without_reply 10 @comments = @comments.without_reply
14 end 11 end
15 12
16 -end  
17 \ No newline at end of file 13 \ No newline at end of file
  14 +end
plugins/comment_paragraph/views/comment_paragraph_plugin_profile/view_comments.rjs
1 -if @paragraph_comment_page == 1  
2 - page.replace_html "comments_list_paragraph_#{@paragraph_id}", :partial => 'comment/comment.html.erb', :collection => @comments  
3 -else  
4 - page.insert_html :bottom, "comments_list_paragraph_#{@paragraph_id}", :partial => 'comment/comment.html.erb', :collection => @comments  
5 -end 1 +page.replace_html "comments_list_paragraph_#{@paragraph_id}", :partial => 'comment/comment.html.erb', :collection => @comments
6 page.replace_html "comment-count-#{@paragraph_id}", @comments_count 2 page.replace_html "comment-count-#{@paragraph_id}", @comments_count
7 -  
8 -if @no_more_pages  
9 - page.replace_html "comments_list_paragraph_#{@paragraph_id}_more", ""  
10 -else  
11 - page.replace_html "comments_list_paragraph_#{@paragraph_id}_more", link_to_remote(_('More'), :url => { :profile => profile.identifier, :controller => 'comment_paragraph_plugin_profile', :action => 'view_comments', :paragraph_id => @paragraph_id, :article_id => @article_id, :paragraph_comment_page => @paragraph_comment_page + 1}, :loaded => visual_effect(:highlight, "comments_list_paragraph_#{@paragraph_id}"), :method => :post, :complete => "loadCompleted(#{@paragraph_id})")  
12 -end