<div class="box-body">
  <% if @product.errors.any? %>
    <%= raw errors_to_html(@product.errors) %>
  <% end %>
  <div class="row">
    <div class="col-md-6">
      <div class="form-group has-success">
        <label>Nazwa</label>
        <%= text_field :product, :name, class: "form-control", placeholder: 'Nazwa' %>
      </div>
    </div>
    <div class="col-md-3">
      <div class="form-group">
        <label>Cena</label>
        <%= text_field :product, :price, class: "form-control", placeholder: 'Cena' %>
      </div>
    </div>
    <div class="col-md-3">
      <div class="form-group">
        <label>Ilość</label>
        <%= text_field :product, :quantity, class: "form-control", placeholder: 'Ilość' %>
      </div>
    </div>
  </div>
  <div class="row">
    <div class="col-md-6">
      <div class="form-group">
        <label>Krótki opis</label>
        <%= text_area :product, :description_short, class: 'form-control', rows: 3 %>
      </div>
    </div>
    <div class="col-md-6">
      <div class="form-group">
        <label>Opis pełny</label>
        <%= text_area :product, :description, class: "summernote" %>
      </div>
    </div>
  </div>
  <div class="row">
  <div class="col-md-6">
    <div class="form-group">
      <label>Zdjęcia</label>
      <%= file_field_tag "images[]", type: :file, multiple: true, accept: 'image/png,image/gif,image/jpeg' %>
    </div>
  </div>
</div>
  <%= hidden_field :product, :default_category_id %>
  <div class="box-footer">
    <%= submit_tag 'Zapisz', class: "btn btn-primary" %>
  </div>

</div>

<script type="text/javascript">
  $(document).ready(function() {
    $('.summernote').summernote({
      height: 200,
      tabsize: 2,
      lang: 'pl-PL',
      toolbar: [
        ['style'],
        ['style', ['bold', 'italic', 'underline', 'hr', 'strikethrough', 'clear', 'fontname', 'superscript', 'subscript']],
        ['fontsize', ['fontsize']],
        ['color', ['color']],
        ['para', ['ul', 'ol', 'paragraph']],
        ['insert', ['picture', 'link', 'video']],
        ['table', ['table']],
        ["view", ["fullscreen", "codeview"]],
        ['height', ['height']],
        ['history', ['undo', 'redo']],
        ['help', ['help']]
      ]
    });
  });
</script>
