{% extends "layout_2_col.html" %}
{% load currency_filters %}
{% load thumbnail %}
{% 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">{% blocktrans with q=query%}"{{ q }}"{% endblocktrans %}</li>
</ul>
{% endblock %}

{% 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 header%}
<div class="page-header">
	<h1>{% trans 'Search for' %} '{{ query }}'</h1>
</div>
{% 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">
		{% if page_obj %}
			{% include "catalogue/partials/pagination.html" %}
		{% endif %}
		<ol class="products four">
			{% for result in page.object_list %}
			<li>{% include "catalogue/partials/product.html" with product=result.object %}</li>
			{% endfor %}
		</ol>
		{% if page_obj %}
			{% include "catalogue/partials/pagination.html" %}
		{% endif %}
	</div>
</section>
{% else %}
<p>{% trans 'No search results found.' %}</p>
{% endif %}

{% endblock %}
