Take queries out of reshare

This commit is contained in:
Raphael 2010-11-30 11:43:08 -08:00
parent 4c25724573
commit b0522535ac
2 changed files with 4 additions and 2 deletions

View file

@ -7,6 +7,6 @@
= link_to t('.reshare'), "#"
%ul.reshare_box
- for aspect in current_user.aspects
- for aspect in aspects
%li.aspect_to_share= link_to aspect, :controller => "aspects", :action => "show", :id => aspect.id, :prefill => post.message

View file

@ -22,7 +22,9 @@
%a{:href => "/aspects/#{aspect.id}"}=aspect.name
.right
= render 'shared/reshare', :current_user => current_user, :post => post if post.is_a? StatusMessage
- reshare_aspects = aspects.reject{|a| post.aspect_ids.include?(a.id)}
- unless reshare_aspects.empty?
= render 'shared/reshare', :current_user => current_user, :aspects => aspects, :post => post
= link_to t('delete'), status_message_path(post), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :class => "delete"
= render 'status_messages/status_message', :post => post, :photos => post.photos