{% load i18n %}
{% if pagination.total_pages > 1 %}
<div class="products-navigation">
    {% if pagination.first_page %}
    <span class="first-page">
        <a href="{{ pagination.url }}?{{ pagination.getparam }}={{ pagination.first_page }}{{ pagination.getvars }}">{% trans "First page" %}</a>
    </span>
    {% endif %}
    {% if pagination.has_prev %}
    <span class="previous-page">
        <a href="{{ pagination.url }}?{{ pagination.getparam }}={{ pagination.prev }}{{ pagination.getvars }}">{% trans "Previous page" %}</a>
    </span>
    {% endif %}

    {% for p in pagination.page_range %}
      {% if p == pagination.current_page %}
        <span class="current">{{ p }}</span>
      {% else %}
        <a href="{{ pagination.url }}?{{ pagination.getparam }}={{ p }}{{ pagination.getvars }}">{{ p }}</a>
      {% endif %}
    {% endfor %}

    {% if pagination.has_next %}
    <span class="next-page">
        <a href="{{ pagination.url }}?{{ pagination.getparam }}={{ pagination.next }}{{ pagination.getvars }}">{% trans "Next page" %}</a>
    </span>
    {% endif %}

    {% if pagination.last_page %}
    <span class="last-page">
      <a href="{{ pagination.url }}?{{ pagination.getparam }}={{ pagination.last_page }}{{ pagination.getvars }}">{% trans "Last page" %}</a>
    </span>
    {% endif %}

    <span class="products-total">
        {% blocktrans count counter=amount_of_products %}({{ amount_of_products }} product){% plural %}({{ amount_of_products }} products){% endblocktrans %}
    </span>
</div>
{% endif %}
