Fix and simplify likes_container

This commit is contained in:
Raphael Sofaer 2011-08-03 11:19:48 -07:00
parent 5967f01dab
commit 67123a277c
2 changed files with 4 additions and 10 deletions

View file

@ -5,16 +5,10 @@
.likes_container .likes_container
- if likes_count > 0 - if likes_count > 0
= image_tag('icons/heart.svg') = image_tag('icons/heart.svg')
- if defined?(likes_index_link) && likes_index_link - if target_type == "Comment"
- if target_type == "Comment" = t('likes.likes.people_like_this_comment', :count => likes_count)
= link_to t('likes.likes.people_like_this_comment', :count => likes_count), post_likes_path(target_id), :class => "expand_likes"
- else
= link_to t('likes.likes.people_like_this', :count => likes_count), post_likes_path(target_id), :class => "expand_likes"
- else - else
- if target_type == "Comment" = link_to t('likes.likes.people_like_this', :count => likes_count), post_likes_path(target_id), :class => "expand_likes"
= t('likes.likes.people_like_this_comment', :count => likes_count)
- else
= t('likes.likes.people_like_this', :count => likes_count)
%span.hidden.likes_list %span.hidden.likes_list
/= render 'likes/likes', :likes => likes /= render 'likes/likes', :likes => likes

View file

@ -67,6 +67,6 @@
= link_to t('comments.new_comment.comment'), '#', :class => 'focus_comment_textarea' = link_to t('comments.new_comment.comment'), '#', :class => 'focus_comment_textarea'
.likes.on_post .likes.on_post
= render "likes/likes_container", :target_id => post.id, :likes_count => post.likes_count, :current_user => current_user, :likes_index_link => true, :target_type => "Post" = render "likes/likes_container", :target_id => post.id, :likes_count => post.likes_count, :current_user => current_user, :target_type => "Post"
= render "comments/comments", :post => post, :current_user => current_user, :commenting_disabled => (defined?(@commenting_disabled) && @commenting_disabled) = render "comments/comments", :post => post, :current_user => current_user, :commenting_disabled => (defined?(@commenting_disabled) && @commenting_disabled)