<div class="container">
<div class="spepro">
 <h1 class="heading text-center"><span>NOVO</span><p>{{ catheadsub_title }}</p></h1>
    <div class="row rless">
        {# Koristimo ID 'latest' ali klase iz special fajla (dodata klasa 'cbp') #}
        <div id="latest" class="owl-theme owl-carousel cbp">
            {% for product in products %}
            <div class="multi-row">
                <div class="product-layout col-xs-12 cless">
                    <div class="product-thumb transition">
                        <div class="image">
                            <div class="owl-feadditional ">
                                <a href="{{ product.href }}"><img src="{{ product.thumb }}" alt="{{ product.name }}" title="{{ product.name }}" class="img-responsive center-block" /></a>
                                
                                {# Pixel Images logika iz special fajla #}
                                {% set t = 0 %}
                                {% for webi_image in product.webi_images %}
                                    {% if t == 0 or t == 1 %}
                                        <a href="{{ product.href }}"><img src="{{ webi_image.popup }}" class="img-responsive" alt="hover image"/></a>
                                        {% set t = t + 1 %}
                                    {% endif %}
                                {% endfor %}
                            </div>
                            
                            {% if product.is_new %}
                                <span class="new">{{ pro_new }}</span>
                            {% endif %}
                            
                            {% if product.tag_per %}
                                <span class="sale">{{ product.tag_per }}%</span>
                            {% endif %}
                        </div>

                        <div class="caption text-center">
                            {% if product.price %}
                                <div class="price">
                                    {% if not product.special %}
                                        {{ product.price }}
                                    {% else %}
                                        <span class="price-new">{{ product.special }}</span> <span class="price-old">{{ product.price }}</span>
                                    {% endif %}
                                </div>
                            {% endif %}
                            
                            <div class="rat-pri">
                                <h4 class="protitle"><a href="{{ product.href }}">{{ product.name }}</a></h4>
                                {% if product.rating %}
                                    <div class="rating">
                                        {% for i in 1..5 %}
                                            {% if product.rating < i %}
                                                <span class="fa fa-stack">
                                                    <i class="fa fa-star-o fa-stack-2x"></i>
                                                </span>
                                            {% else %}
                                                <span class="fa fa-stack">
                                                    <i class="fa fa-star fa-stack-2x"></i><i class="fa fa-star-o fa-stack-2x"></i>
                                                </span>
                                            {% endif %}
                                        {% endfor %}
                                    </div>
                                {% else %}
                                    <div class="rating">
                                        {% for i in 1..5 %}
                                            <span class="fa fa-stack"><i class="fa fa-star-o fa-stack-2x"></i></span>
                                        {% endfor %}
                                    </div>
                                {% endif %}
                            </div>

                            <div class="button-group">
                                <div class="add-cart">
                                    <button type="button" data-toggle="tooltip" title="{{ button_wishlist }}" onclick="wishlist.add('{{ product.product_id }}');"><svg><use xlink:href="#heart" /></svg></button>
                                    <button type="button" class="cartb" data-toggle="tooltip" title="{{ button_cart }}" onclick="cart.add('{{ product.product_id }}');"><svg><use xlink:href="#pcart"></use></svg><span class="hidden-xs hidden-sm">{{ button_cart }}</span></button>
                                    <button type="button" data-toggle="tooltip" title="{{ button_compare }}" onclick="compare.add('{{ product.product_id }}');"><svg><use xlink:href="#compare"/></svg></button>
                                </div>
                                <div class="absbtn">
                                    <div data-toggle="tooltip" title="Quickview" class="bquickv"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            {% endfor %}
        </div>
    </div>
</div>
</div>

<script type="text/javascript">
    $(document).ready(function() {
        // Inicijalizacija na #latest ID sa podešavanjima iz special fajla
        $("#latest").owlCarousel({
            itemsCustom : [
                [0, 1],
                [320, 2],
                [576, 3],
                [768, 3],
                [992, 4],
                [1200, 5],
                [1410, 5],
                [1590, 6]
            ],
            autoPlay: 3000,       /* 3 sekunde rotacija kao u special */
            stopOnHover: true,    /* Pauza na hover kao u special */
            scrollPerPage: false, /* Glatko pomeranje */
            navigationText: ['<i class="fa fa-caret-left"></i>', '<i class="fa fa-caret-right"></i>'],
            navigation : true,
            pagination:false
        });
    });
</script>