{% load i18n template_tools %}
{% if is_paginated %}
    <nav>
        <ul class="pagination">
            {% if page_obj.previous_url %}
                <li>
                    {% if form_id %}
                        <button type="submit" form="{{ form_id }}" name="page" value="{{ page_obj.previous_number }}">
                            {% trans 'Previous' %}
                        </button>
                    {% else %}
                        <a href="?{{ page_obj.previous_url }}">
                            {% trans 'Previous' %}
                        </a>
                    {% endif %}
                </li>
            {% endif %}
            <li>
                <a class="disabled">
                    {% blocktrans with current_page_number=page_obj.number total_page_number=page_obj.paginator.num_pages %}
                        Page {{ current_page_number }} of {{ total_page_number }}.
                    {% endblocktrans %}
                </a>
            </li>
            {% if page_obj.next_url %}
                <li>
                    {% if form_id %}
                        <button type="submit" form="{{ form_id }}" name="page" value="{{ page_obj.next_number }}">
                            {% trans 'Next' %}
                        </button>
                    {% else %}
                        <a href="?{{ page_obj.next_url }}">
                            {% trans 'Next' %}
                        </a>
                    {% endif %}
                </li>
            {% endif %}
        </ul>
    </nav>
{% endif %}
