Commits

Jorge Ezequiel Diaz Marquez committed fd784ec

fix paginator

Comments (0)

Files changed (2)

statics/templates/djcatalog/base.html

 							<div class="clear"></div>
                         </div>
                        {% block product_catalog %}
-                       {% comment %}
-                        <!-- todos los productos -->
-                        <div class="todos-productos" id="carousel_catalog">
-                            <ul>
-                                {% for product in product_list %}
-                                {% with product.get_first_image as media %}
-                                <li><a href="{{ product.get_absolute_url }}" pos="{{ forloop.counter }}"><img src="{% if media.thumbnail %}{{ media.thumbnail.url }}{% endif %}" alt="{{ product.description }}" title="{{ product.name }}"/></a></li>
-                                {% endwith %}
-                                {% endfor %}
-                            </ul>
-                            <div class="clear"></div>
-                        </div>
-                        <!-- end todos los productos -->
-                       {% endcomment %}
+
                        {% endblock %}
                         </div>
                     <!-- end general categorias -->
                 <!-- wraper-page-productos -->
 
 
-                <script>
-                    var mycarousel_itemList = [{% for product in product_list %}{% with product.get_media_content|first as media %}{url:"{% if media.content %}{{ media.content.url }}{% endif %}",title:"{{ product.name }}"}{% if not forloop.last %},{% endif %}{% endwith %}{% endfor %}];
 
-                function mycarousel_initCallback(carousel) {
-                    jQuery('#carousel_catalog a').bind('click', function() {
-                        carousel.scroll(
-                            jQuery.jcarousel.intval(
-                                jQuery(this).attr('pos')
-                            )
-                        );
-                        $('#product_description').html($('img',this).attr('alt'));
-                        $('#product_category_title').html($('img',this).attr('title'));
-                        return false;
-                    });
-
-                };
-
-                function mycarousel_itemLoadCallback(carousel, state)
-                {
-                    for (var i = carousel.first; i <= carousel.last; i++) {
-                        if (carousel.has(i)) {
-                            continue;
-                        }
-
-                        if (i > mycarousel_itemList.length) {
-                            break;
-                        }
-
-                        carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[i-1]));
-                    }
-                };
-
-                /**
-                 * Item html creation helper.
-                 */
-                function mycarousel_getItemHTML(item)
-                {
-                    return '<div><img src="' + item.url + '" alt="' + item.url + '" /></div>';
-                };
-
-
-                // Ride the carousel...
-                jQuery(document).ready(function() {
-
-                    jQuery("ul li img").lazyload();
-                    jQuery("#carousel_product").jcarousel({
-                        scroll: 1,
-                        {% if object %}
-                        {% for product in product_list %}{% if object.pk == product.pk %}
-                        start: {{ forloop.counter }},
-                        {% endif %}{% endfor %}
-                        {% endif %}
-
-                        size: mycarousel_itemList.length,
-                        itemLoadCallback: {onBeforeAnimation: mycarousel_itemLoadCallback},
-                        initCallback: mycarousel_initCallback,
-                        // This tells jCarousel NOT to autobuild prev/next buttons
-                        buttonNextHTML: null,
-                        buttonPrevHTML: null
-                    });
-                });
-
-                </script>
 
                 {% endblock %}
 

statics/templates/djcatalog/catalog_list.html

 </div>
 <!-- end todos los productos -->
 <div class="oh">{% include "_paginator.html" %}</div>
+
+
+<script>
+    var mycarousel_itemList = [{% for product in object_list %}{% with product.get_media_content|first as media %}{url:"{% if media.content %}{{ media.content.url }}{% endif %}",title:"{{ product.name }}"}{% if not forloop.last %},{% endif %}{% endwith %}{% endfor %}];
+
+function mycarousel_initCallback(carousel) {
+    jQuery('#carousel_catalog a').bind('click', function() {
+        carousel.scroll(
+            jQuery.jcarousel.intval(
+                jQuery(this).attr('pos')
+            )
+        );
+        $('#product_description').html($('img',this).attr('alt'));
+        $('#product_category_title').html($('img',this).attr('title'));
+        return false;
+    });
+
+};
+
+function mycarousel_itemLoadCallback(carousel, state)
+{
+    for (var i = carousel.first; i <= carousel.last; i++) {
+        if (carousel.has(i)) {
+            continue;
+        }
+
+        if (i > mycarousel_itemList.length) {
+            break;
+        }
+
+        carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[i-1]));
+    }
+};
+
+/**
+ * Item html creation helper.
+ */
+function mycarousel_getItemHTML(item)
+{
+    return '<div><img src="' + item.url + '" alt="' + item.url + '" /></div>';
+};
+
+
+// Ride the carousel...
+jQuery(document).ready(function() {
+
+    jQuery("ul li img").lazyload();
+    jQuery("#carousel_product").jcarousel({
+        scroll: 1,
+        {% if object %}
+        {% for product in product_list %}{% if object.pk == product.pk %}
+        start: {{ forloop.counter }},
+        {% endif %}{% endfor %}
+        {% endif %}
+
+        size: mycarousel_itemList.length,
+        itemLoadCallback: {onBeforeAnimation: mycarousel_itemLoadCallback},
+        initCallback: mycarousel_initCallback,
+        // This tells jCarousel NOT to autobuild prev/next buttons
+        buttonNextHTML: null,
+        buttonPrevHTML: null
+    });
+});
+
+</script>
 {% endblock %}