-#   Copyright (c) 2010-2011, Diaspora Inc.  This file is
-#   licensed under the Affero General Public License version 3 or later.  See
-#   the COPYRIGHT file.

.dropdown{:class => ["hang_#{hang}", defined?(dropdown_class) && dropdown_class]}
  .button.toggle{:class => ("in_aspects" if selected_aspects.size > 0)}
    - if selected_aspects.size == all_aspects.size
      = t('all_aspects')
    - elsif selected_aspects.size == 1
      = selected_aspects.first.name
    - else
      = t('.toggle', :count => selected_aspects.size)
    &#9660;

  .wrapper
    %ul.dropdown_list{:unSelectable => 'on', 'data-person_id' => (person.id if defined?(person) && person), 'data-service_uid' => (service_uid if defined?(service_uid)), 'data-person-short-name' => (person.first_name if defined?(person) && person)}
      - for aspect in all_aspects
        = aspect_dropdown_list_item(aspect, aspect_membership_ids[aspect.id] )

      - if (dropdown_may_create_new_aspect && defined?(person) && person)
        %li.newItem
          .add_aspect
            = link_to t('contacts.index.add_a_new_aspect'), new_aspect_path(:person_id => person.id, :remote => true), :rel => 'facebox'
