From c034113a7c91fb60fd65c279b5fc33050d56f45d Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 6 Dec 2010 15:47:57 -0800 Subject: [PATCH] Refactor to aspect partial --- app/views/aspects/_aspect.haml | 9 +++++++++ app/views/shared/_aspect_contacts.haml | 9 +-------- 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 app/views/aspects/_aspect.haml diff --git a/app/views/aspects/_aspect.haml b/app/views/aspects/_aspect.haml new file mode 100644 index 000000000..8c0f229bb --- /dev/null +++ b/app/views/aspects/_aspect.haml @@ -0,0 +1,9 @@ +%li + %h4 + = link_to aspect, aspect + %span + = t('contacts', :count => contact_count) + + - if contact_count > 0 + - for person in people + = person_image_link(person) diff --git a/app/views/shared/_aspect_contacts.haml b/app/views/shared/_aspect_contacts.haml index b4dcdc5f0..269739098 100644 --- a/app/views/shared/_aspect_contacts.haml +++ b/app/views/shared/_aspect_contacts.haml @@ -45,15 +45,8 @@ %ul - for a_hash in @aspect_hashes - %li - %h4 - = link_to a_hash[:aspect], a_hash[:aspect] - %span - = t('contacts', :count=>a_hash[:contact_count]) + = render :partial => 'aspects/aspect', :locals => a_hash - - if a_hash[:contact_count] > 0 - - for person in a_hash[:people] - = person_image_link(person) .section %h3= t('.invites') = render "shared/invitations", :invites => @invites