.contain
  %h1 Listing profiles

  %div{style: "align-self: start;"}
    - if policy(Profile).new?
      = link_to '+ New Profile', new_profile_path
    - else 
      = link_to 'Sign In', new_user_session_path 
      to create a new Profile

.contain
  - @profiles.each do |profile|
    = link_to profile, class: "profile" do
      %h1= profile.name
      %span= profile.summary
      .social-links
        - profile.social_links.each do |social_link|
          = social_link.to_icon.html_safe
      %p= profile.about
      %span #{profile.followers.count} Followers
      &nbsp;&nbsp;
      %span #{profile.microposts.count} Posts
      - if policy(profile).destroy?
        = link_to 'Edit', edit_profile_path(profile)
        = link_to 'Delete', profile, method: :delete, data: { confirm: 'Are you sure?' }
