{% load i18n %}

<div class="pagination" >

    <div class="ui-grid-a">
        <div class="ui-block-a">
        {% if page.has_previous %}
            <a href="?page={{ page.previous_page_number }}"
               data-role="button">« {% trans "previous" %}</a>
        {% else %}
            <button disabled="">« {% trans "previous" %}</button>
        {% endif %}
        </div>

        <div class="ui-block-b">
        {% if page.has_next %}
        <a href="?page={{ page.next_page_number }}"
           data-role="button">{%trans "next" %} »</a>
        {% else %}
            <button disabled="">{%trans "next" %} »</button>
        {% endif %}
        </div>
    </div>


    <div data-role="controlgroup" data-type="horizontal" style="text-align:center;">
    {% for i in page_range %}
        {% if page.number != i %}
            <a href="?page={{ i }}"
               data-role="button">{{i}}</a>
        {% else %}
            <button disabled="">
            {{i}}
            </button>
        {% endif %}
    {% endfor %}
    </div>

</div>


