{% extends "layout.html" %}


{% load i18n %}
{% load product_tags %}

{% block title %}
{% trans "Offers" %} | {{ block.super }}
{% endblock %}

{% block breadcrumbs %}
<ul class="breadcrumb">
    <li>
	<a href="{{ homepage_url }}">{% trans "Home" %}</a>
        <span class="divider">/</span>
    </li>
    <li class="active">{% trans "Offers" %}</li>
</ul>
{% endblock %}

{% block headertext %}
    {% trans "Offers" %}
{% endblock %}

{% block content %}
    {% if not offers %}
        <p>{% trans "There are no site offers at the moment." %}</p>
    {% else %}
        {% for offer in offers %}
        <h4>{{ offer.name }}</h4>
        {% if offer.description %}
            <p>{{ offer.description|safe }}</p>
        {% endif %}
        {% if offer.has_products %}
            <ul class="row-fluid">
                {% for product in offer.products|slice:":12" %}
                <li class="span2 {% if forloop.counter0|divisibleby:"6" %}no-margin{% endif %}">{% render_product product %}</li>
                {% endfor %}
            </ul>
            <p>
                <a class="btn" href="{% url 'offer:detail' slug=offer.slug %}">{% trans "Browse products in offer" %}</a>
            </p>
        {% endif %}
        <hr/>
        {% endfor %}
    {% endif %}
{% endblock content %}
