{% extends "layout_2_col.html" %}

{% load url from future %}
{% load currency_filters %}
{% load thumbnail %}
{% load product_tags %}
{% load i18n %}

{% block title %}
    "{{ query }}" | {{ block.super }}
{% endblock %}

{% block breadcrumbs %}
    <ul class="breadcrumb">
        <li>
            <a href="{% url 'promotions:home' %}">{% trans "Home" %}</a>
            <span class="divider">/</span>
        </li>
        <li>
            {% trans "Search" %}
            <span class="divider">/</span>
        </li>
        <li class="active">"{{ query }}"</li>
    </ul>
{% endblock %}

{% block column_left %}
    {% if has_facets %}
        <h4>{% trans "Refine your search" %}</h4>
        <dl>
            {% for field, data in facet_data.items %}
                {% if data.results %}
                    {% include 'search/partials/facet.html' with name=data.name items=data.results %}
                {% endif %}
            {% endfor %}
        </dl>
    {% endif %}
{% endblock %}

{% block headertext %}
    {% blocktrans with q=query %}
        Products matching "{{ q }}"
    {% endblocktrans %}
{% endblock %}

{% block content %}

    {% if suggestion %}
        {% trans 'Did you mean' %} <a href="{% url 'search:search' %}?q={{ suggestion }}">{{ suggestion }}</a>?
    {% endif %}

    {% if page.object_list %}
        <section>
            <div class="mod">
                {% include "search/partials/pagination.html" %}
                <ol class="row-fluid">
                    {% for result in page.object_list %}
                        <li class="span3 {% if forloop.counter0|divisibleby:"4" %}no-margin{% endif %}">{% render_product result.object %}</li>
                    {% endfor %}
                </ol>
                {% include "search/partials/pagination.html" %}
            </div>
        </section>
    {% else %}
        <p>{% trans 'No search results found.' %}</p>
    {% endif %}

{% endblock %}
