Skip to content

Commit

Permalink
Adjust carousel on the offer list page
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Price authored and codeinthehole committed Apr 8, 2013
1 parent fcdf2d6 commit 2dcc1b2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
9 changes: 7 additions & 2 deletions oscar/static/oscar/js/oscar/ui.js
Expand Up @@ -117,9 +117,14 @@ var oscar = (function(o, $) {
var gallery = $(this).parent('.rg-thumbs').length;
// Don't apply this to the gallery carousel
if (gallery <= 0) {
var imageWidth = 175,
minProducts = 4;
if ($(this).hasClass('wide')) {
minProducts = 5;
}
$(this).elastislide({
imageW: 175,
minItems: 4,
imageW: imageWidth,
minItems: minProducts,
onClick: function() {return true;}
});
}
Expand Down
2 changes: 1 addition & 1 deletion oscar/templates/oscar/offer/detail.html
Expand Up @@ -43,7 +43,7 @@ <h3><i class="icon-exclamation-sign icon-large"></i> {% trans "What you need to
<section>
<div class="mod">
{% include "partials/pagination.html" %}
<ol class="products four">
<ol class="products five">
{% for product in products %}
<li>{% render_product product %}</li>
{% endfor %}
Expand Down
37 changes: 18 additions & 19 deletions oscar/templates/oscar/offer/list.html
Expand Up @@ -25,26 +25,25 @@
<p>{% trans "There are no site offers at the moment." %}</p>
{% else %}
{% for offer in offers %}
<div class="well">
<h4>{{ offer.name }}</h4>
{% if offer.description %}
<p>{{ offer.description|safe }}</p>
{% endif %}
{% if offer.has_products %}
<div class="es-carousel-wrapper">
<div class="es-carousel">
<ul class="products">
{% for product in offer.products|slice:":12" %}
<li>{% render_product product %}</li>
{% endfor %}
</ul>
</div>
<h4>{{ offer.name }}</h4>
{% if offer.description %}
<p>{{ offer.description|safe }}</p>
{% endif %}
{% if offer.has_products %}
<div class="es-carousel-wrapper wide">
<div class="es-carousel">
<ul class="products">
{% for product in offer.products|slice:":12" %}
<li>{% render_product product %}</li>
{% endfor %}
</ul>
</div>
<p>
<a class="btn" href="{% url offer:detail offer.slug %}">{% trans "Browse products in offer" %}</a>
</p>
{% endif %}
</div>
</div>
<p>
<a class="btn" href="{% url offer:detail offer.slug %}">{% trans "Browse products in offer" %}</a>
</p>
{% endif %}
<hr/>
{% endfor %}
{% endif %}
{% endblock content %}

0 comments on commit 2dcc1b2

Please sign in to comment.