.wrapper
  -img_url = "/cacao.jpg"
  %section.module-cover.text-center.with_ratio{"data-background" => "#{img_url}", "data-overlay" => "0.5", "data-ratio" => "0.3"}
    .container.vertical_center
      .row
        .col-md-12
          %h2
            Coordonnées & livraison
  

=render :partial => "public/p_orders/menu"


.container.particulars_process

  =semantic_form_for [:public, @current_p_customer_sheet],:url => particulars_save_public_p_orders_path, :html => { :method => :post, :onchange =>""}, :remote => false do |form|

    .addresses.row.spaced-grid{:style => "margin:0 -10px;"}

      .col-md-6{:style => "padding:0 10px;"}
        %h3
          =qit('billing-address', 'Adresse de facturation')

        %p
          =qit('select-billing-address', 'Sélectionner votre adresse de facturation ci-dessous')
          =link_to qit('or-modify', "(ou modifier)"), public_particulars_path(:for_order => true)
        -if @current_p_customer_sheet.price_line_block.p_customer
          =form.inputs do
            =form.semantic_fields_for :price_line_block do |form|
              = form.input :particular_bill_id, :collection => @p_customer_sheet.price_line_block.p_customer.particulars.all, :as => :select, :member_label => :address_line, :include_blank => false, :label => false
        -else
          =form.inputs do
            = form.input :particular_bill_id, :collection => [], :as => :select, :include_blank => false, :label => false
        -if @p_customer_sheet.particular_bill and @p_customer_sheet.particular_bill.errors.size > 0
          .alert.alert-danger
            =qit('invalid-address', 'Cette adresse n\'est pas valide, veuillez la renseigner ou')
            =qit('complete', "la compléter")
            =link_to qit('complete', "la compléter"), edit_public_particular_path(:id => @p_customer_sheet.particular_bill_id, :order => true)
            ou
            =link_to qit('create-new', "en créer une nouvelle."), new_public_particular_path(:for_order => true)





      .col-md-6{:style => "padding:0 10px;"}
        %h3
          =qit('delivery-address', 'Adresse de livraison')

        %p
          =qit('select-delivery-address', 'Sélectionner votre adresse de livraison ci-dessous')
          =link_to qit('or-add', "(ou ajouter)"), public_particulars_path(:for_order => true)

        -if @p_customer_sheet.p_customer
          =form.inputs do
            =form.semantic_fields_for :price_line_block do |form|
              = form.input :particular_send_id, :collection => @p_customer_sheet.price_line_block.p_customer.particulars.all, :as => :select, :member_label => :address_line, :include_blank => false, :label => false

        -else
          =form.inputs do
            = form.input :particular_send_id, :collection => [], :as => :select, :include_blank => false, :label => false

        -if @p_customer_sheet.particular_send and @p_customer_sheet.particular_send.errors.size > 0
          .alert.alert-danger
            =qit('invalid-address')
            =qit('complete', "la compléter")
            =link_to qit('complete', "la compléter"), edit_public_particular_path(:id => @p_customer_sheet.particular_bill_id, :order => true)
            ou
            =link_to qit('create-new', "en créer une nouvelle."), new_public_particular_path(:order => true)
    %br
    %br
    .text-right
      =form.submit "#{qit('resume-order', "Récapitulatif de commande")} >", :class => "btn btn-primary"
    .clear
    %br
    %br