diff --git a/app/helpers/comments_helper.rb b/app/helpers/comments_helper.rb index 13f788c13..492b38eae 100644 --- a/app/helpers/comments_helper.rb +++ b/app/helpers/comments_helper.rb @@ -42,4 +42,8 @@ module CommentsHelper false end end + + def all_comments? + defined?(request_parameters) && !! params['all_comments'] + end end diff --git a/app/views/comments/_comments.html.haml b/app/views/comments/_comments.html.haml index daf379a32..f8cfa7e30 100644 --- a/app/views/comments/_comments.html.haml +++ b/app/views/comments/_comments.html.haml @@ -2,13 +2,13 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. .comment_stream - - unless comments_expanded || params['all_comments'] + - unless comments_expanded || all_comments? %ul.show_comments{:class => ("hidden" if post.comments.size <= 3)} %li = comment_toggle( post) %ul.comments{:class => ('loaded' if post.comments.size <= 3)} - -if post.comments.size > 3 && !comments_expanded && ! params['all_comments'] + -if post.comments.size > 3 && !comments_expanded && ! all_comments? = render :partial => 'comments/comment', :collection => post.comments.last(3), :locals => {:post => post} -else = render :partial => 'comments/comment', :collection => post.comments, :locals => {:post => post}