{% extends "layout_2_col.html" %}
{% load currency_filters %}
{% load basket_tags %}
{% load promotion_tags %}
{% load product_tags %}
{% load i18n %}

{% block title %}
{{ summary }} | {{ block.super }}
{% endblock %}

{% block headertext %}{{ summary }}{% endblock  %}

{% block breadcrumbs %}
<ul class="breadcrumb">
    <li>
        <a href="{% url promotions:home %}">{% trans "Home" %}</a>
        <span class="divider">/</span>
    </li>
    {% if not category %}
        <li class="active">{% trans "All products" %}</li>
    {% else %}
        {% for category in category.get_ancestors|slice:":-1" %}
        <li>
            <a href="{{ category.get_absolute_url }}">{{ category.name }}</a>
            <span class="divider">/</span>
        </li>
        {% endfor %}
        <li class="active">{{ category.name }}</li>
    {% endif %}
</ul>
{% endblock breadcrumbs %}

{% block column_left %}
    <div class="side_categories" style="padding: 8px 0;">
        {% if categories %}
    	<ul class="nav nav-list">
			<li class="nav-header">{% trans "Browse categories" %}</li>
    	    {% for category in categories %}
            <li><a href="{{ category.0.get_absolute_url }}">{{ category.0.name }}</a>
            	{% if category.1 %}
            	<ul>
                    {% for subcategory in category.1 %}
                        <li><a href="{{ subcategory.0.get_absolute_url }}">{{ subcategory.0.name }}</a>
                    {% endfor %}
            	</ul>
                {% endif %}
            </li>
            {% endfor %}
    	</ul>
    	{% endif %}
    </div>
{% endblock %}

{% block content %}
    {% if category.description %}
        <div class="row-fluid">
            <div class="span9"><p>{{ category.description|safe }}</p></div>
            {% if category.image %}
                <div class="span3"><img src="{{ category.image.url }}" alt="{{ summary }}" /></div>
            {% endif %}
        </div>
    {% endif %}

    {% if products.count %}
    <section>
        <div class="mod">
            <ol class="products four">
                {% for product in products %}
                    <li>{% render_product product %}</li>
                {% endfor %}
            </ol>
            {% include "partials/pagination.html" %}
        </div>
    </section>
    {% else %}
        <p class="nonefound">{% trans "No products found." %}</p>
    {% endif %}
{% endblock content %}
