<% query ||= @query %>

<%= render(:partial => 'easy_contacts/export_vcard_encoding_selector') %>

<% content_for :easy_page_layout_service_box do %>

  <% if params[:back_url] %>
    <%= link_to(l(:button_back), params[:back_url], :class => 'button') -%>
  <% end %>

  <%= link_to( l(:label_easy_contact_personal), easy_contacts_path(:filter => 2, :back_url => params[:back_url] || (project ? project_easy_contacts_path(project) : easy_contacts_overview_path)), :class => 'button icon icon-fav') if project.nil? -%>
  <%= link_to l(:label_easy_contact_group), polymorphic_path([project, :easy_contact_groups]), :class => 'button  icon icon-group' if User.current.allowed_to_globally?(:manage_easy_contact_groups, {})  -%>
  <%= link_to l(:label_easy_contacts_import), import_preview_easy_contacts_path(:project_id => project), :class => 'button icon icon-import' if User.current.allowed_to_globally?(:manage_easy_contacts, {})  -%>
  <%= link_to( l(:button_easy_contact_homepage), easy_contacts_path(filter: 0, back_url: params[:back_url] || (project ? project_easy_contacts_path(project) : easy_contacts_overview_path)), :class => 'button icon icon-group' ) -%>
  <%= link_to(l(:label_easy_contact_types), easy_contact_types_path, class: 'button icon icon-templates') if User.current.allowed_to_globally?(:manage_easy_contact_types) %>
  <%= link_to_entity_mapper(l(:button_easy_entity_attribute_vcard_map), easy_contacts_path,  EasyContact, EasyExtensions::Export::EasyVcard, :class => 'button icon icon-settings', :force_map => true) %>

  <%= render :partial => 'sidebar/saved_easyqueries_by_type', :locals => {:query_class => query.class, :project => project} if query -%>
<% end %>
