From 0f84eba86fb2d9056c4d663e587f78b5e892c8bc Mon Sep 17 00:00:00 2001 From: Marcelo JĂșnior Date: Wed, 22 Oct 2014 12:47:39 -0300 Subject: [PATCH] comment_paragraph: remove pagination support --- plugins/comment_paragraph/controllers/profile/comment_paragraph_plugin_profile_controller.rb | 5 +---- plugins/comment_paragraph/views/comment_paragraph_plugin_profile/view_comments.rjs | 12 +----------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/plugins/comment_paragraph/controllers/profile/comment_paragraph_plugin_profile_controller.rb b/plugins/comment_paragraph/controllers/profile/comment_paragraph_plugin_profile_controller.rb index e4fb02a..19f2c7a 100644 --- a/plugins/comment_paragraph/controllers/profile/comment_paragraph_plugin_profile_controller.rb +++ b/plugins/comment_paragraph/controllers/profile/comment_paragraph_plugin_profile_controller.rb @@ -4,13 +4,10 @@ class CommentParagraphPluginProfileController < ProfileController def view_comments @article_id = params[:article_id] @paragraph_id = params[:paragraph_id] - article = profile.articles.find(@article_id) - @paragraph_comment_page = (params[:paragraph_comment_page] || 1).to_i - @comments = article.comments.without_spam.in_paragraph(@paragraph_id) @comments_count = @comments.count @comments = @comments.without_reply end -end \ No newline at end of file +end diff --git a/plugins/comment_paragraph/views/comment_paragraph_plugin_profile/view_comments.rjs b/plugins/comment_paragraph/views/comment_paragraph_plugin_profile/view_comments.rjs index fc4a2cb..f1d9e07 100644 --- a/plugins/comment_paragraph/views/comment_paragraph_plugin_profile/view_comments.rjs +++ b/plugins/comment_paragraph/views/comment_paragraph_plugin_profile/view_comments.rjs @@ -1,12 +1,2 @@ -if @paragraph_comment_page == 1 - page.replace_html "comments_list_paragraph_#{@paragraph_id}", :partial => 'comment/comment.html.erb', :collection => @comments -else - page.insert_html :bottom, "comments_list_paragraph_#{@paragraph_id}", :partial => 'comment/comment.html.erb', :collection => @comments -end +page.replace_html "comments_list_paragraph_#{@paragraph_id}", :partial => 'comment/comment.html.erb', :collection => @comments page.replace_html "comment-count-#{@paragraph_id}", @comments_count - -if @no_more_pages - page.replace_html "comments_list_paragraph_#{@paragraph_id}_more", "" -else - 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})") -end -- libgit2 0.21.2