From 7f5dc1472617af0cc842e87df7bab1d18183f97b Mon Sep 17 00:00:00 2001 From: maxwell Date: Thu, 2 Dec 2010 15:18:54 -0800 Subject: [PATCH] fix dup comment showing with comments with more than three, also fixed veribage --- app/helpers/stream_helper.rb | 4 +++- app/views/comments/_comments.html.haml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/helpers/stream_helper.rb b/app/helpers/stream_helper.rb index 61cee6f8e..d29f62849 100644 --- a/app/helpers/stream_helper.rb +++ b/app/helpers/stream_helper.rb @@ -5,7 +5,9 @@ module StreamHelper def comment_toggle(count) - if count < 3 + if count == 0 + link_to "#{t('comments.new_comment.comment').downcase}", '#', :class => "show_post_comments" + elsif count < 3 link_to "#{t('stream_helper.hide_comments')} (#{count})", '#', :class => "show_post_comments" else link_to "#{t('stream_helper.show_comments')} (#{count})", '#', :class => "show_post_comments" diff --git a/app/views/comments/_comments.html.haml b/app/views/comments/_comments.html.haml index e41964902..a13a30d90 100644 --- a/app/views/comments/_comments.html.haml +++ b/app/views/comments/_comments.html.haml @@ -5,7 +5,7 @@ %ul.comments{:id => post_id, :class => ("hidden" if comment_hashes.size == 0)} -if comment_hashes.size > 3 .older_comments.hidden.inactive - = render :partial => 'comments/comment', :collection => comment_hashes[0..-3], :as => :hash + = render :partial => 'comments/comment', :collection => comment_hashes[0..-4], :as => :hash = render :partial => 'comments/comment', :collection => comment_hashes[-3, 3], :as => :hash -else = render :partial => 'comments/comment', :collection => comment_hashes, :as => :hash