{% extends "aircox/basepage_list.html" %}
{% comment %}Display a list of Pages{% endcomment %}
{% load i18n aircox %}

{% block before_list %}
{{ block.super }}

{% if view.has_filters and object_list %}
<form method="GET" action="" class="media">
    <div class="media-content">
        {% block filters %}
        <div class="field is-horizontal">
            <div class="field-label">
                <label class="label">{% translate "Search" %}</label>
            </div>
            <div class="field-body">
                <div class="field">
                    <div class="control has-icons-left">
                        <span class="icon is-small is-left">
                            <i class="fa fa-search"></i>
                        </span>
                        <input class="input" type="text" name="q"
                            value="{{ filterset_data.q }}"
                            placeholder="{% translate "Search content" %}">
                    </div>
                </div>
            </div>
        </div>
        <div class="field is-horizontal">
            <div class="field-label">
                <label class="label">{% translate "Categories" %}</label>
            </div>
            <div class="field-body">
                <div class="field is-narrow">
                    <div class="control">
                        {% for label, value in categories %}
                        <label class="checkbox">
                            <input type="checkbox" class="checkbox" name="category__id__in"
                                   value="{{ value }}"
                                   {% if value in filterset_data.category__id__in %}checked{% endif %} />
                            {{ label }}
                        </label>
                        {% endfor %}
                    </div>
                </div>
            </div>
        </div>
        {% endblock %}
    </div>
    <div class="media-right">
        <div class="field is-grouped is-grouped-right">
            <div class="control">
                <button class="button is-primary"/>{% translate "Apply" %}</button>
            </div>
            <div class="control">
                <a href="?" class="button is-secondary">{% translate "Reset" %}</a>
            </div>
        </div>
    </div>
</form>
{% endif %}
{% endblock %}
