= semantic_form_for [:admin,@product], :remote => true do |form| 

  .content
    =form.input :product_category_id, :label => "Catégorie :", :collection => @categories_select, :as => :select, :include_blank => false
    
    -if @product.product_category_id
      =form.input :product_collection_id, :label => "Collection :", :collection => ProductCollection.where(:product_category_id => @product.product_category_id).map{|i| [i.lang("fr").name, i.id]}, :as => :select, :include_blank => true
    
    =form.semantic_fields_for :product_langs do |product_lang| 

    

      = product_lang.inputs do
        = product_lang.hidden_field :id
        = product_lang.hidden_field :lang
        = product_lang.input :title, :as => :string, :label => "Nom (#{product_lang.object.lang}) :"
        = product_lang.input :description, :label => "Descirption (#{product_lang.object.lang}) :", :input_html => {:class => "redactor_textarea"}
        
        :javascript
          $(".redactor_textarea").redactor({
                  focus: true,
                  callbacks: {
                      init: function()
                      {
                  
                      }
                  }
              });
      
        :css
          .redactor-editor{
            padding: 24px 32px;

            border: 1px solid rgba(0, 0, 0, 0.07);
          }
        
        
        
        
    =form.input :price_ht, :label => "Prix (HT) :"
    =form.input :price_reduced_ht, :label => "Prix (HT) avec réduction :"
    
    
    
    %hr
    %h3
      Options
    %p= link_to_add_fields "Ajouter une ligne", form, :product_options 

    .product_options_form
      =form.semantic_fields_for :product_options do |form|
        =render :partial => "admin/product_options/form", :locals => {:form => form}
    %hr
    %h3 Tailles possibles :
    =form.input :product_sizes, :collection => ProductSize.where("archived is null").order(:position).all, :as => :check_boxes, :label => "Tailles"
        
  .actions
    = form.submit "Sauvegarder", :class => "btn btn-primary"
  