<%# this partial expects 2 local to be declared -- -%>
<%# 1) "object" for which the avatar is displayed (object.name() method should be available for any supplied object); -%>

<%= panel(nil, :class => 'text-center') do %>
  <div>
    <%= favouritable_icon(object, 120) -%>
  </div>
  
  <% if object.instance_of?(Person) -%>
      <div style="padding-top: 0.5em">
        <%= seek_role_icons(@person) -%>
      </div>
  <% end -%>
  <% if object && (mine?(object) || object.can_be_edited_by?(current_user)) -%>
      <span style="font-size:smaller">
      <%= image_tag_for_key("avatars", all_avatars_link(object), nil, nil, "Change picture") %>
      </span>
  <% end %>
<% end %>

<%# this partial expects 2 local to be declared -- -%>
<%# 1) "object" for which the avatar is displayed (object.name() method should be available for any supplied object); -%>

<%= panel(nil, :class => 'text-center') do %>
  <div>
    <%= favouritable_icon(object, 120) -%>
  </div>
  
  <% if object.instance_of?(Person) -%>
      <div style="padding-top: 0.5em">
        <%= seek_role_icons(@person) -%>
      </div>
  <% end -%>
  <% if object && (
          User.admin_logged_in? ||
          mine?(object) ||
          ([Project, Institution].include?(object.class) && object.can_be_edited_by?(current_user))) -%>
      <span style="font-size:smaller">
      <%= image_tag_for_key("avatars", all_avatars_link(object), nil, nil, "Change picture") %>
      </span>
  <% end %>
<% end %>

Hide "change picture" link when user doesn't actually have permission to do so
Hide "change picture" link when user doesn't actually have permission to do so
