% filtered_params = params.respond_to?(:to_unsafe_hash) ? params.to_unsafe_hash : params %>
<% if !@tag %>
<%= form_tag(filtered_params, :id => "query_form", :method => :get) do %>
<%= hidden_field_tag('project_id', @project.to_param) if @project %>
<%= l(:label_crm_contact_all_note_plural) %>
<%= text_field_tag(:search_note, params[:search_note], :autocomplete => "off", :class => "live_search_field", :placeholder => l(:label_crm_contact_search) ) %>
<% end %>
<% else %>
<%= "#{l(:label_crm_contact_tag)}(#{@notes_pages.item_count}): #{tag_links(@tag)}".html_safe %>
<% end %>
<%= render :partial => 'notes/notes_list' %>
<% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => filtered_params.merge(:key => User.current.atom_key) %>
<% end %>
<% content_for :sidebar do %>
<%= l(:label_crm_note_plural) %>
<% collection_for_note_types_select.each do |note_type| %>
<%= radio_button_tag "note_type", note_type[1], filtered_params[:type_id].to_s == note_type[1].to_s, {:onchange => "document.location='#{url_for(filtered_params.merge(:type_id => note_type[1]))}';", :id => "note_type_#{note_type[1]}" }%>
<%= label_tag "note_type_#{note_type[1]}", note_type[0] %>
<% end %>
<%= l(:label_crm_tags_plural) %>
<%= @tags.map{|tag| content_tag(:span, link_to(tag.name, {:controller => "contacts", :action => "contacts_notes", :project_id => @project, :tag => tag.name}), {}.merge(ContactsSetting.monochrome_tags? ? {:class => "tag-label"} : {:class => "tag-label-color", :style => "background-color: #{tag_color(tag.name)}"}))}.join(' ').html_safe %>
<% end %>
<% content_for(:header_tags) do %>
<%= javascript_include_tag :contacts, :plugin => 'redmine_contacts' %>
<% end %>