%tr#p_product_ref{:id => p_product_ref.id}
  
  -tr = {}
    
    
  
  -tr[:p_product_cat] = capture do
    %td
      =p_product_ref.p_product.p_product_cat.name if p_product_ref.p_product and p_product_ref.p_product.p_product_cat
    
    -if false
      %td.cat_select{:style => "padding-top:3px;padding-bottom:1px;"}
        .dropdown
          %button.btn.btn-default.dropdown-toggle{"aria-expanded" => "true", "aria-haspopup" => "true", "data-toggle" => "dropdown", :type => "button"}
            %span.span_cat
              -if p_product_ref.p_product and p_product_ref.p_product.p_product_cat
                = p_product_ref.p_product.p_product_cat.name
            %span.caret
          %ul.dropdown-menu{"aria-labelledby" => "dropdownMenu1"}
            -@purchase_p_product_cats.each do |pppc|
              %li
                =link_to admin_p_product_path(:id => p_product_ref.p_product_id, :p_product => {:p_product_cat_id => pppc.id}), :method => :put, :remote => true, :onclick => "$(this).closest('td').find('.span_cat').html($(this).find('span').html());", :class => "dropdown-item" do
                  =ic :check if false
                  %span=pppc.name
          
          
              


  -tr[:actions] = capture do
    %td.actions
      =# link_to i(:"trash-o"), [:admin, p_product_ref], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer ce produit ? ' } , :remote => true if !PriceLine.where(:p_product_ref_id => p_product_ref).first
      =#debug PriceLine.where(:p_product_ref_id => p_product_ref.id).first
      
      -if @manager
        = link_to i(:eye), admin_p_product_ref_path(p_product_ref), :remote => false, :target => "_blank"
        = link_to i(:"check"), "#",:onclick => "send_manager_product('"+p_product_ref.id.to_s+"', '"+escape_javascript(p_product_ref.member_label.to_s)+"');return false;"
        
      -else
        = link_to i(:pencil), edit_admin_p_product_path(p_product_ref.p_product), :remote => false
        = link_to i(:eye), admin_p_product_ref_path(p_product_ref), :remote => false
      

  =render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => p_product_ref}
    
  