{% 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 {% block seeker-page-select-id-attribute %}id="seeker-page-size-select"{% endblock seeker-page-select-id-attribute %} aria-label='Display Per Page'>
	                {% 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 total_hits page_size=page_size page=page spread=page_spread template='advanced_seeker/pager.html' %}
            {% if total_hits >= paginator_cap %}
                <p class="help-block text-center">**Paging has been limited to the first {{ paginator_cap|intcomma }} results.**</p>
            {% endif %}
        {% endblock seeker-pager %}
    </div>
{% endblock seeker-pagination %}

{% block seeker-export %}
    {% 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 {% block export-form-id-attribute %}id="export-form"{% endblock export-form-id-attribute %} 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 {{ total_hits|intcomma }} result{{ total_hits|pluralize }} in {{ results.took }} millisecond{{ results.took|pluralize }}</em>
                    {% block export-link %}&mdash; <button {% block export-link-id-attribute %}id="export-link"{% endblock export-link-id-attribute %} class="btn btn-link">{% trans "Export these results" %}</button>{% endblock export-link %}
                </p>
            </form>
    {% else %}
    <em>Found {{ total_hits|intcomma }} result{{ total_hits|pluralize }} in {{ results.took }} millisecond{{ results.took|pluralize }}</em>
    {% endif %}
{% endblock seeker-export %}
