Commit 0f84eba86fb2d9056c4d663e587f78b5e892c8bc
1 parent
9e4f2aa4
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
comment_paragraph: remove pagination support
Showing
2 changed files
with
2 additions
and
15 deletions
Show diff stats
plugins/comment_paragraph/controllers/profile/comment_paragraph_plugin_profile_controller.rb
... | ... | @@ -4,13 +4,10 @@ class CommentParagraphPluginProfileController < ProfileController |
4 | 4 | def view_comments |
5 | 5 | @article_id = params[:article_id] |
6 | 6 | @paragraph_id = params[:paragraph_id] |
7 | - | |
8 | 7 | article = profile.articles.find(@article_id) |
9 | - @paragraph_comment_page = (params[:paragraph_comment_page] || 1).to_i | |
10 | - | |
11 | 8 | @comments = article.comments.without_spam.in_paragraph(@paragraph_id) |
12 | 9 | @comments_count = @comments.count |
13 | 10 | @comments = @comments.without_reply |
14 | 11 | end |
15 | 12 | |
16 | -end | |
17 | 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 | 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 | ... | ... |