<div class="row">
  <div class="col-md-6">
    <h5 class="thin subtitle">Adres dostawy</h5>
    <div class="form-group">
      <div>
        <div class="row">
          <div class="col-md-1">
            <%= check_box(:order, :terms_of_service_acceptance, { class: 'styled' }) %>
          </div>
          <div class="col-md-11">
            <label for="order_terms_of_service_acceptance">
              Oświadczam, że zapoznałem/łam się z regulaminem i akceptuję warunki w nim zawarte
              <%= link_to 'czytaj..', '/site/regulamin-sklepu', target: '_blank' %>
            </label>
          </div>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-sm-6">
        <div class="form-group">
          <%= text_field(:order, :first_name, class: 'form-control input-md required', placeholder: 'Imie', required: 'required') %>
        </div>
        <!-- end form-group -->
        <div class="form-group">
          <%= email_field(:order, :email, class: 'form-control input-md', placeholder: 'Adres email', required: 'required') %>
        </div>
        <!-- end form-group -->
      </div>
      <!-- end col -->
      <div class="col-sm-6">
        <div class="form-group">
          <%= text_field(:order, :last_name, class: 'form-control input-md required', placeholder: 'Nazwisko', required: 'required') %>
        </div>
        <!-- end form-group -->
        <div class="form-group">
          <%= text_field(:order, :phone, class: 'form-control input-md required', placeholder: 'Telefon', required: 'required') %>
        </div>
        <!-- end form-group -->
      </div>
    </div>
    <!-- end row -->
    <div class="form-group">
      <%= text_field(:order, :street, class: 'form-control input-md required', placeholder: 'Ulica', required: 'required') %>
    </div>
    <!-- end form-group -->
    <div class="row">
      <div class="col-sm-6">
        <div class="form-group">
          <%= text_field(:order, :city, class: 'form-control input-md required', placeholder: 'Miasto', required: 'required') %>
        </div>
        <!-- end form-group -->
      </div>
      <!-- end col -->
      <div class="col-sm-6">
        <div class="form-group">
          <%= text_field(:order, :zip_code, class: 'form-control input-md required', placeholder: 'Kod pocztowy', required: 'required') %>
        </div>
        <!-- end form-group -->
      </div>
      <!-- end col -->
    </div>
    <!-- end row -->

  </div>
  <!-- end col -->

  <div class="col-md-6">
    <h5 class="thin subtitle">Sposób dostawy</h5>
    <div class="form-group input-group-lg">
      <%= select(:order, :shipping_id, @shippings.collect {|p| [ "#{p.name} (PLN #{format('%.2f', p.price)})", p.id ] }, {}, { class: 'form-control' }) %>
    </div>
    <!-- end form-group -->

    <div class="form-group"></div>
    <!-- end collapse -->
    <div class="form-group">
      <%= text_area(:order, :message_from_client, rows: 6, class: 'form-control', placeholder: 'Wiadomość dla sprzedawcy') %>
    </div>
    <!-- end form-group -->
  </div>

  <!-- end col -->
</div>
<!-- end row -->
<script>
  $(document).ready(function () {
    $('#order_shipping_id').change(function () {
      changeShipping($(this).val());
    });
  });
</script>
