{% load seeker %}
{% load i18n %}

{% block seeker-pagination %}
    <div class="pull-right">
        {# NOTE: Because Advanced Search is ajax based, it is up to the site to add a JS listener for the page size input #}
        {% if available_page_sizes %}
            <div class="page-size-selector">
	            Display Per Page:
	            <select id="seeker-page-size-select">
	                {% for size in available_page_sizes %}
	                    <option value="{{ size }}" {% if size == page_size %}selected{% endif %}>{{ size }}</option>
	                {% endfor %}
	            </select>
            </div>
        {% endif %}
        {% block seeker-pager %}
            {% seeker_pager results.hits.total page_size=page_size page=page spread=page_spread template='advanced_seeker/pager.html' %}
        {% endblock seeker-pager %}
    </div>
{% endblock seeker-pagination %}

{% if export_name %}
    {# NOTE: By default, the export link will export ALL records.  It is up to the site to add an on submit JS listener to #export-form that will set the value of #export-search-object accordingly #}
        <form id="export-form" method="POST" target="_blank"> {% csrf_token %}
            <input type="hidden" id="export-search-object" name="search_object" value='{"query":{"condition":"AND","rules":[]},"page":1,"sort":"","display":[],"keywords":"","type":"simple","url":"."}' />
            <input type="hidden" name="_export" value="true" />
            <p>
                <em>Found {{ results.hits.total|intcomma }} result{{ results.hits.total|pluralize }} in {{ results.took }} millisecond{{ results.took|pluralize }}</em>
                {% block export-link %}&mdash;<button id="export-link" class="btn btn-link">{% trans "Export these results" %}</button>{% endblock export-link %}
            </p>
        </form>
{% else %}
<em>Found {{ results.hits.total|intcomma }} result{{ results.hits.total|pluralize }} in {{ results.took }} millisecond{{ results.took|pluralize }}</em>
{% endif %}
