{% extends "base.html" %}

{% load i18n future mezzanine_tags %}

{% block meta_title %}{% trans "Search Results" %}{% endblock %}
{% block title %}{% trans "Search Results" %}{% endblock %}

{% block breadcrumb_menu %}
<li>
    <a href="{% url "home" %}">{% trans "Home" %}</a>
    <span class="divider">/</span>
</li>
<li class="active">{% trans "Search Results" %}</li>
{% endblock %}

{% block main %}

<p>
{% if results.paginator.count == 0 %}
{% blocktrans %}
No results were found in {{ search_type }} matching your query: {{ query }}
{% endblocktrans %}
{% else %}
{% blocktrans with start=results.start_index end=results.end_index total=results.paginator.count %}
Showing {{ start }} to {{ end }} of {{ total }} results in {{ search_type }} matching your query: {{ query }}
{% endblocktrans %}
{% endif %}
</p>

<div id="search-results">
    {% for result in results.object_list %}
    <h5>{{ forloop.counter0|add:results.start_index }})
        <a href="{{ result.get_absolute_url }}">{{ result }}</a></h5>
    <p>{{ result.description|truncatewords_html:20|safe }}</p>
    <a href="{{ result.get_absolute_url }}">{% trans "read more" %}</a>
    {% endfor %}
</div>

{% pagination_for results %}

{% endblock %}
