{% load i18n %}
{% if not is_ajax %}
    {% comment %}
        HACK: This template expects to be passed a 'linkurl' parameter, containing a URL name
        that can be reverse-resolved by the {% url %} tag with no further parameters.
        Views that have parameters in their URL can work around this by passing a bogus
        (but non-blank) URL name, which will return an empty string and produce a final URL
        of the form "?q=123", implicitly preserving the current URL path.
        Using the {% url ... as ... %} form of the tag ensures that this fails silently,
        rather than throwing a NoReverseMatch exception.
    {% url linkurl as url_to_use %}
   {% endcomment %}
{% endif %}
<div class="pagination">
    <p>{% blocktrans with page_num=attempts.number total_pages=attempts.paginator.num_pages %}Page {{ page_num }} of {{ total_pages }}.{% endblocktrans %}</p>
    <ul>
        <li class="prev">
            {% if attempts.has_previous %}
                <a href="{{ url_to_use }}?p={{ attempts.previous_page_number }}" class="icon icon-arrow-left">{% trans 'Previous' %}</a>
            {% endif %}
        </li>
        <li class="next">
            {% if submissions.has_next %}
                <a href="{{ url_to_use }}?p={{ attempts.next_page_number }}" class="icon icon-arrow-right-after">{% trans 'Next' %}</a>
            {% endif %}
        </li>
    </ul>
</div>