{% with zui_pagination_url=zui_pagination_url|default:"?" %}
    {% if num_pages > 1 %}
        <ul class="{{ pagination_css_classes }}">

            <li class="previous{% if current_page == 1 %} disabled{% endif %}">
                <a href="{% if current_page == 1 %}#{% else %}{{ zui_pagination_url }}page=1{% endif %}">&laquo;</a>
            </li>

            {% if pages_back %}
                <li>
                    <a href="{{ zui_pagination_url }}page={{ pages_back }}">&hellip;</a>
                </li>
            {% endif %}

            {% for p in pages_shown %}
                <li{% if current_page == p %} class="active"{% endif %}>
                    <a href="{% if current_page == p %}#
                    {% else %}{{ zui_pagination_url }}page={{ p }}{% endif %}">{{ p }}</a>
                </li>
            {% endfor %}

            {% if pages_forward %}
                <li>
                    <a href="{{ zui_pagination_url }}page={{ pages_forward }}">&hellip;</a>
                </li>
            {% endif %}

            <li class="next{% if current_page == num_pages %} disabled{% endif %}">
                <a href="{% if current_page == num_pages %}#
                {% else %}{{ zui_pagination_url }}page={{ num_pages }}{% endif %}">&raquo;</a>
            </li>

        </ul>
    {% endif %}
{% endwith %}
