{% import 'appbuilder/baselib.html' as baselib %}
{% import 'appbuilder/general/lib.html' as lib %}

<form id="filter_form" class="form-search" method="get">

    <div class="btn-group">
        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
        {{_("Add Filter")}}
      <span class="caret"></span>
        </button>
        <ul class="dropdown-menu">
            {% for col in include_cols %}
            <li><a href="#" name="{{col}}" class="filter">
                {{ label_columns[col] }}</a>
            </li>
            {% endfor %}
        </ul>
    </div>

    <table class="table table-responsive table-hover filters">
        <tbody>

        </tbody>
    </table>

{{ lib.btn_search() }}
</form>

<script nonce="{{ baselib.get_nonce() }}">
	(function($) {
        const filter = new AdminFilters(
            '#filter_form',
            {{ label_columns | tojson }},
            {{ form_fields | tojson }},
            {{ search_filters | tojson }},
            {{ active_filters | tojson }}
        );
    })(jQuery);

</script>
