<%= render '/product/partials/product_modal' %>
<% if @category.active_childrens.size > 0 %>
  <div class="title-wrap">
    <h2 class="title lines">Kategorie</h2>
  </div>
  <% row = 0 %>
    <% for cat in @category.active_childrens %>
      <% if row == 0 %>
        <div class="row column-4">
        <% end %>
        <div class="col-sm-6 col-md-3">
          <div class="thumbnail store style2">
            <div class="header">
              <figure style="height:338px; background-color: white;">
                <% if !cat.cover_image.blank? %>
                  <%= link_to(image_tag(cat.cover_image.image.url(:large), style: 'margin: auto;vertical-align: middle;display: inline-block;'), category_path(cat), style: 'line-height: 338px;') %>
                <% else %>
                  <%= link_to(image_tag('kaktus.png'), category_path(cat)) %>
                <% end %>
              </figure>
            </div>
            <div class="caption">
              <h6 class="regular"><%= link_to(cat.name, category_path(cat)) %></h6>
            </div>
            <!-- end caption -->
          </div>
          <!-- end thumbnail -->
        </div>
        <% row += 1
          if row == 4
            row = 0
        %>
        </div>
      <% end %>
    <% end %>
    <% if row > 0 && row < 4 %>
    </div>
  <% end %>
<% end %>
<% if @products.size > 0 %>
  <div class="title-wrap">
    <h2 class="title lines">Produkty</h2>
  </div>
  <div id="products_list">
    <%= render '/product/partials/products_thumbnails' %>
    <div>
    <% end %>

    <script type="text/javascript">
      $(document).ready(function () {
        $(".productQuickView").on('hidden.bs.modal', function () {
          $(this).data('bs.modal', null);
        });
      });
    </script>
