
{# Pagination for default django.core.paginator.Paginator #}
{# This template will work with CBV views with ``paginate_by`` specified. #}
{% load i18n %}

{% if is_paginated %}
<nav class="page-navigation" aria-label="page navigation">
    <ul>
        {% if page_obj.has_previous %}
            <li class="prev">
                <a href="?page={{ page_obj.previous_page_number|stringformat:"d" }}{{ getvars }}{{ hashtag }}">
                    <i></i>
                    {% trans "Previous" %}
                </a>
            </li>
        {% else %}
            <li class="prev disabled">
                <a>{% block pagination_previous_label %}<i></i> {% trans "Previous" %}{% endblock %}</a>
            </li>
        {% endif %}
        {% for page in paginator.page_range %}
            <li class="{% ifequal page page_obj.number %}active{% endifequal %}">
                <a href="?page={{ page|stringformat:"d" }}{{ getvars }}{{ hashtag }}">{{ page|stringformat:"d" }}</a>
            </li>
        {% endfor %}
        {% if page_obj.has_next %}
            <li class="next">
                <a href="?page={{ page_obj.next_page_number|stringformat:"d" }}{{ getvars }}{{ hashtag }}">
                    {% trans "Next" %}
                    <i></i>
                </a>
            </li>
        {% else %}
            <li class="next disabled">
                <a>{% block pagination_next_label %}
                    {% trans "Next" %}
                    <i></i>
                    {% endblock %}
                </a>
            </li>
        {% endif %}
    </ul>
</nav>
{% endif %}
