fix dup comment showing with comments with more than three, also fixed veribage

This commit is contained in:
maxwell 2010-12-02 15:18:54 -08:00
parent 93da0ddd25
commit 7f5dc14726
2 changed files with 4 additions and 2 deletions

View file

@ -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"

View file

@ -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