<nav>
    <ul class='pagination'>
        {% if page_obj.number == 1 %}
        <li class='disabled'><span>First</span></li>
        {% else %}
        <li><a href='?page=1'>First</a></li>
        {% endif %}

        {% if page_obj.has_previous %}
        <li><a href='?page={{ page_obj.previous_page_number }}'>Previous</a></li>
        {% else %}
        <li class='disabled'><span>Previous</span></li>
        {% endif %}

        {% for page in page_obj.paginator.page_range %}
            {% if page_obj.number == page %}
            <li class='active'><span>{{ page }}</span></li>
            {% else %}
            <li><a href='?page={{ page}}'>{{ page }}</a></li>
            {% endif %}
        {% endfor %}

        {% if page_obj.has_next %}
        <li><a href='?page={{ page_obj.next_page_number }}'>Next</a></li>
        {% else %}
        <li class='disabled'><span>Next</span></li>
        {% endif %}

        {% if page_obj.number == page_obj.paginator.num_pages %}
        <li class='disabled'><span>Last</span></li>
        {% else %}
        <li><a href='?page={{ page_obj.paginator.num_pages }}'>Last</a></li>
        {% endif %}
    </ul>
</nav>
