Browse Source

Adjust carousel on the offer list page

Fixes #596
master
Jon Price 13 years ago
parent
commit
2dcc1b2c40

+ 7
- 2
oscar/static/oscar/js/oscar/ui.js View File

@@ -117,9 +117,14 @@ var oscar = (function(o, $) {
117 117
                 var gallery = $(this).parent('.rg-thumbs').length;
118 118
                 // Don't apply this to the gallery carousel
119 119
                 if (gallery <= 0) {
120
+                    var imageWidth = 175,
121
+                        minProducts = 4;
122
+                    if ($(this).hasClass('wide')) {
123
+                        minProducts = 5;
124
+                    }
120 125
                     $(this).elastislide({
121
-                        imageW: 175,
122
-                        minItems: 4,
126
+                        imageW: imageWidth,
127
+                        minItems: minProducts,
123 128
                         onClick: function() {return true;}
124 129
                     });
125 130
                 }

+ 1
- 1
oscar/templates/oscar/offer/detail.html View File

@@ -43,7 +43,7 @@
43 43
 		<section>
44 44
 			<div class="mod">
45 45
 				{% include "partials/pagination.html" %}
46
-				<ol class="products four">
46
+				<ol class="products five">
47 47
 					{% for product in products %}
48 48
                     <li>{% render_product product %}</li>
49 49
 					{% endfor %}

+ 18
- 19
oscar/templates/oscar/offer/list.html View File

@@ -25,26 +25,25 @@
25 25
         <p>{% trans "There are no site offers at the moment." %}</p>
26 26
     {% else %}
27 27
         {% for offer in offers %}
28
-        <div class="well">
29
-            <h4>{{ offer.name }}</h4>
30
-            {% if offer.description %}
31
-                <p>{{ offer.description|safe }}</p>
32
-            {% endif %}
33
-            {% if offer.has_products %}
34
-                <div class="es-carousel-wrapper">
35
-                    <div class="es-carousel">
36
-                        <ul class="products">
37
-                            {% for product in offer.products|slice:":12" %}
38
-                            <li>{% render_product product %}</li>
39
-                            {% endfor %}
40
-                        </ul>
41
-                    </div>
28
+        <h4>{{ offer.name }}</h4>
29
+        {% if offer.description %}
30
+            <p>{{ offer.description|safe }}</p>
31
+        {% endif %}
32
+        {% if offer.has_products %}
33
+            <div class="es-carousel-wrapper wide">
34
+                <div class="es-carousel">
35
+                    <ul class="products">
36
+                        {% for product in offer.products|slice:":12" %}
37
+                        <li>{% render_product product %}</li>
38
+                        {% endfor %}
39
+                    </ul>
42 40
                 </div>
43
-                <p>
44
-                    <a class="btn" href="{% url offer:detail offer.slug %}">{% trans "Browse products in offer" %}</a>
45
-                </p>
46
-            {% endif %}
47
-        </div>
41
+            </div>
42
+            <p>
43
+                <a class="btn" href="{% url offer:detail offer.slug %}">{% trans "Browse products in offer" %}</a>
44
+            </p>
45
+        {% endif %}
46
+        <hr/>
48 47
         {% endfor %}
49 48
     {% endif %}
50 49
 {% endblock content %}

Loading…
Cancel
Save