{% load i18n %}{% spaceless %}
{% if paginator and paginator.num_pages > 1 %}
<nav aria-label="{% trans "Pagination" %}">
    <ul class="pagination justify-content-center mt-3">
        {% for page_num in paginator.page_range %}
        <li class="page-item{% if page_num == page_obj.number %} active{% endif %}"
            {% if page_num == page_obj.number %} aria-current="page"{% endif %}>
            <a class="page-link" href="{% querystring page=page_num %}">{{ page_num }}</a>
        </li>
        {% endfor %}
    </ul>
</nav>
{% endif %}
{% endspaceless %}