%tr
  %td{:style => "width:100px"}
    =link_to public_product_path(:id => product_order_product.product.id, :slug => product_order_product.product.lang(I18n.locale).slug) do
      =image_tag product_order_product.product.default_image.image_file.file.large.medium.small.thumb.url if product_order_product.product.default_image
  %td
    %strong
      =link_to public_product_path(:id => product_order_product.product.id, :slug => product_order_product.product.lang(I18n.locale).slug) do
        = product_order_product.product.lang(:fr).title
    %br
    = product_order_product.product_size.name if product_order_product.product_size
    = product_order_product.product_option.lang(I18n.locale).name if product_order_product.product_option
  


  

  %td.boutique-right
    = number_to_currency(product_order_product.dyn_price_ht.to_f, locale: :fr)

  %td{:style => "width:150px;text-align:center;"}
    -if !@recap
      .qty_form
        = form_for [:public, product_order_product] do |f|
        
          -if product_order_product.product.constraint_qty
            -if product_order_product.product.step_stop?
              -max = product_order_product.product.step_stop
            -else
              -max = 500
              
            -if product_order_product.product.step_start?
              -min = product_order_product.product.step_start
            -else
              -min = 1
              
            -if product_order_product.product.step_group?
              -group = product_order_product.product.step_group
            -else
              -group = 10
            
            -qte_table = [min.to_i]
            
            -i = min
            -while i < max do
              -i += group
              -qte_table << i.to_i

            = f.select :qty, qte_table, {:style => "width:30px;"}
            
          -else
            -if [1,2].include?(product_order_product.product_id)
              = f.select :qty, [10,20,30,40,50,60,70,80,90,100, 150, 200, 250, 300, 400, 500, 600, 700, 800, 900, 1000], {:style => "width:30px;"}
            -else
              = f.text_field :qty, :style => "width:30px;"
          = f.submit "Mettre à jour"
          =link_to ic(:"trash-o"), public_product_order_product_path(:id => product_order_product.id, :product_order_product => {:qty => 0}), :method => :put
    -else
      =product_order_product.qty
  %td.boutique-right
    = number_to_currency(product_order_product.final_price_ht_with_qty, locale: :fr)
