{% if is_paginated %}
    <ul class="pagination">
        {% if page_obj.has_previous %}
            <li class="waves-effect">
                <a href="?page={{ page_obj.previous_page_number }}">
                    <i class="material-icons">chevron_left</i>
                </a>
            </li>
        {% else %}
            <li class="disabled"><a href="#!"><i class="material-icons">chevron_left</i></a></li>
        {% endif %}

        {% with ''|center:page_obj.paginator.num_pages as range %}
            {% for i in range %}
                {% if forloop.counter == page_obj.number %}
                    <li class="active"><a href="#!">{{ forloop.counter }}</a></li>
                {% else %}
                    <li class="waves-effect"><a href="?page={{ forloop.counter }}">{{ forloop.counter }}</a></li>
                {% endif %}
            {% endfor %}
        {% endwith %}

        {% if page_obj.has_next %}
            <li class="waves-effect">
                <a href="?page={{ page_obj.next_page_number }}">
                    <i class="material-icons">chevron_right</i>
                </a>
            </li>
        {% else %}
            <li class="disabled"><a href="#!"><i class="material-icons">chevron_right</i></a>
            </li>
        {% endif %}
    </ul>
{% endif %}
    