Don't call aspects_with_post more than once, we can find a prettier place to cache it later
This commit is contained in:
parent
ccecf32f9b
commit
cd0fca8462
1 changed files with 8 additions and 7 deletions
|
|
@ -41,20 +41,21 @@
|
|||
= t('public')
|
||||
·
|
||||
- else
|
||||
- aspects = aspects_with_post(all_aspects, post)
|
||||
- if post.author.owner_id == current_user.id
|
||||
%span.post_scope{:title => t('.shared_with', :aspect_names => aspects_with_post(all_aspects, post).map!{|a| a.name}.join(', '))}
|
||||
- if aspects_with_post(all_aspects, post).size == 1
|
||||
= aspects_with_post(all_aspects, post).first
|
||||
%span.post_scope{:title => t('.shared_with', :aspect_names => aspects.map!{|a| a.name}.join(', '))}
|
||||
- if aspects.size == 1
|
||||
= aspects.first
|
||||
- else
|
||||
= t('limited')
|
||||
(#{aspects_with_post(all_aspects, post).size})
|
||||
(#{aspects.size})
|
||||
- else
|
||||
%span.post_scope
|
||||
- if aspects_with_post(all_aspects, post).size == 1
|
||||
= aspects_with_post(all_aspects, post).first
|
||||
- if aspects.size == 1
|
||||
= aspects.first
|
||||
- else
|
||||
= t('limited')
|
||||
(#{aspects_with_post(all_aspects, post).size})
|
||||
(#{aspects.size})
|
||||
·
|
||||
|
||||
%span.via
|
||||
|
|
|
|||
Loading…
Reference in a new issue