<div class="row">
  <div class="col-md-12">
    <div class="box box-success box-solid">
      <div class="box-header with-border">
        <h3 class="box-title"><%= @product.name %></h3>
      </div>
      <div class="box-body">
        <div class="row">
          <div class="col-md-3">
            <div class="info-box" style="border: 1px solid rgba(0,0,0,0.2);">
              <span class="info-box-icon bg-aqua">
                <i class="fa fa-money"></i>
              </span>
              <div class="info-box-content">
                <span class="info-box-text">Cena</span>
                <span class="info-box-number">
                  <a href="#" class="xedit" data-type="text" data-pk="<%= @product.id %>" data-name="price" data-url="/ps_admin/product/xedit" data-title="Cena"><%= '%.2f' % @product.price %></a>
                </span>
              </div>
            </div>
          </div>
          <div class="col-md-3">
            <div class="info-box" style="border: 1px solid rgba(0,0,0,0.2);">
              <span class="info-box-icon bg-yellow">
                <i class="fa fa-building"></i>
              </span>
              <div class="info-box-content">
                <span class="info-box-text">Ilość</span>
                <span class="info-box-number">
                  <a href="#" class="xedit" data-type="text" data-pk="<%= @product.id %>" data-name="qty" data-url="/ps_admin/product/xedit" data-title="Ilość"><%= @product.quantity %></a>
                </span>
              </div>
            </div>
          </div>
          <div class="col-md-3" id="product_show_active">
            <%= render '/ps_admin/product/partials/set_active' %>
          </div>
          <div class="col-md-3" id="product_show_quantity">
            <%= render '/ps_admin/product/partials/set_chk_quantity' %>
          </div>
        </div>
        <div class="row">
          <div class="col-md-6" id="product_show_images">
            <%= render '/ps_admin/image/partials/images' %>
          </div>
          <div class="col-md-6" id="product_show_images_form">
            <%= render '/ps_admin/image/partials/form' %>
          </div>
        </div>
      </div>
      <div class="box-footer">
        <%= link_to 'Zamknij', '#', class: 'btn btn-success', onclick: 'closeForm()' %>
      </div>
    </div>
  </div>
</div>
<%= stylesheet_link_tag 'bootstrap-editable' %>
<%= javascript_include_tag 'bootstrap-editable' %>
<script>
  $.fn.editable.defaults.mode = 'popup';
  $(document).ready(function () {
    $('.xedit').editable({
      success: function (response, newValue) {
        if (!response.success)
          return response.msg;
        }
      });
  });
</script>
