-if !@manager
  .qi_header
    .right= link_to ic(:plus)+' Ajouter un produit', new_admin_p_product_path(), :class => "btn btn-primary btn-ap-add", :remote => false
    %h1
      Achats
      %span
        Références


        
.qi_search_row
  =form_tag admin_p_product_refs_path, :method => "get",  :onsubmit => "", :remote => true do
    
    =hidden_field_tag :column, params[:column]
    =hidden_field_tag :direction, params[:direction]
    =hidden_field_tag :manager, params[:manager]
    %table
      %tr
        %td
          Actif :
          =select_tag "search[enabled]", options_for_select([[""], "Oui", "Non"], params[:search][:enabled])
        
        
        %td=text_field_tag "search[code]", params[:search][:code],:class => "form-control", :placeholder => "Code"
        
        %td=text_field_tag "search[fournisseur_ref]", params[:search][:fournisseur_ref],:class => "form-control", :placeholder => "Code fournisseur"
        
        
        %td=text_field_tag "search[name]", params[:search][:name],:class => "form-control", :placeholder => "Nom"
       
    %table
      %tr
        %td
          Catégorie :
          =select_tag "search[p_product_ref_cat_id]", options_for_select([["",""],["Aucune","null"]]+PProductCat.order(:name).all.map{|a| [a.name, a.id]}, params[:search][:p_product_ref_cat_id])
        
        %td
          Marque :
          =select_tag "search[s_brand_id]", options_for_select([["",""]]+SBrand.order(:name).all.map{|a| [a.name, a.id]}, params[:search][:s_brand_id])
    
      
      
    =render :partial => "qi/qi_ordered_table_search_footer", :locals => {:collection_object => @p_product_refs}

  
      
#p_product_refs_index_wrapper=render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @p_product_refs, :remote => true}



:javascript
  $('.cat_select .dropdown-menu a').on('click', function (event) {
      $(this).closest('.dropdown').toggleClass('open');
      
  });
  

:coffeescript
  $(".qi_search_row form").on "submit", ->
    $("#p_product_refs_index_wrapper").html('recherche en cours ...')