<% if ContactsSetting[:contacts_show_on_projects_show, @project.id].to_i > 0 && User.current.allowed_to?(:view_contacts, @project) %> <% contacts = Contact.visible.by_project(@project).limit(50).order("#{Contact.table_name}.created_on DESC") %> <% if contacts.length > 0 %>

<%= l(:label_contact_plural) %>

<% if contacts.select{|c| !c.is_company}.any? %>
<% contacts.select{|c| !c.is_company}.each do |contact| %>
<%= link_to avatar_to(contact, :size => "64"), contact_path(contact), :id => "avatar" %> <%= render_contact_tooltip(contact, :icon => true) %>
<% end %>
<% end %> <% if contacts.select{|c| c.is_company}.any? %>
<% contacts.select{|c| c.is_company}.each do |contact| %>
<%= link_to avatar_to(contact, :size => "64"), contact_path(contact), :id => "avatar" %> <%= render_contact_tooltip(contact, :icon => true) %>
<% end %>
<% end %>

<%= link_to l(:label_crm_contact_view_all), :controller => 'contacts', :action => 'index', :project_id => project.id %>

<% end %> <% content_for(:header_tags) do %> <%= javascript_include_tag :contacts, :plugin => 'redmine_contacts' %> <%= stylesheet_link_tag :contacts, :plugin => 'redmine_contacts' %> <% end %> <% end %>