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

<form action="{{ form_action }}" method="get">
    <ul class="nav nav-tabs" role="tablist">
        <li role="presentation" class="active"><a href="#criteria" aria-controls="criteria" role="tab" data-toggle="tab">Search</a></li>
        <li role="presentation"><a href="#display" aria-controls="display" role="tab" data-toggle="tab">Display</a></li>
    </ul>
    <div class="tab-content">
        <div role="tabpanel" class="tab-pane active" id="criteria">
            <div class="form-group">
                <label class="sr-only" for="q">{% trans "Keywords" %}</label>
                <input type="text" class="form-control" placeholder="{% trans "Keywords" %}" name="q" id="q" value="{{ keywords }}" autofocus="autofocus" />
            </div>
            {% for facet, selected in facets.items %}
                <div class="form-group">
                    {% seeker_facet facet results selected %}
                </div>
            {% endfor %}
        </div>
        <div role="tabpanel" class="tab-pane" id="display">
            {% for c in optional_columns %}
                <div class="checkbox">
                    <label>
                        <input type="checkbox" name="d" class="display-field" value="{{ c.field }}"{% if c in display_columns %} checked="checked"{% endif %} />
                        {{ c.label }}
                    </label>
                </div>
            {% endfor %}
        </div>
    </div>
    <div class="form-actions">
        <button type="submit" class="btn btn-primary">{% trans "Filter" %}</button>
        <a href="?q=" class="btn btn-default">{% trans "Reset" %}</a>
    </div>
</form>
