<div role="tabpanel" class="tab-pane" id="tab-filters">
  <div class="panel panel-default">
    <div class="panel-heading">
      {{ lang.mailbox.filters }} <span class="badge badge-info table-lines"></span>
      <div class="btn-group pull-right hidden-xs">
        <button class="btn btn-xs btn-success" href="#" data-acl="{{ acl.filters }}" data-toggle="modal" data-target="#addFilterModalAdmin"><i class="bi bi-plus-lg"></i> {{ lang.mailbox.add_filter }}</button>
        <button class="btn btn-xs btn-default refresh_table" data-draw="draw_filter_table" data-table="filter_table">{{ lang.admin.refresh }}</button>
        <button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown">{{ lang.mailbox.table_size }}
          <span class="caret"></span>
        </button>
        <ul class="dropdown-menu" data-table-id="filter_table" role="menu">
          {% include 'mailbox/page-size.twig' %}
        </ul>
      </div>
    </div>
    <div class="panel-body">
      <p class="help-block">{{ lang.mailbox.sieve_info|raw }}</p><br>
    </div>
{#    <div class="mass-actions-mailbox" data-actions-header="true"></div>#}
    <div class="table-responsive">
      <table class="table table-striped" id="filter_table"></table>
    </div>
    <div class="mass-actions-mailbox">
      <div class="btn-group" data-acl="{{ acl.filters }}">
        <a class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" id="toggle_multi_select_all" data-id="filter_item" href="#"><i class="bi bi-check-all"></i> {{ lang.mailbox.toggle_all }}</a>
        <a class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default dropdown-toggle" data-toggle="dropdown" href="#">{{ lang.mailbox.quick_actions }} <span class="caret"></span></a>
        <ul class="dropdown-menu">
          <li><a data-action="edit_selected" data-id="filter_item" data-api-url='edit/filter' data-api-attr='{"active":"1"}' href="#">{{ lang.mailbox.activate }}</a></li>
          <li><a data-action="edit_selected" data-id="filter_item" data-api-url='edit/filter' data-api-attr='{"active":"0"}' href="#">{{ lang.mailbox.deactivate }}</a></li>
          <li role="separator" class="divider"></li>
          <li><a data-action="edit_selected" data-id="filter_item" data-api-url='edit/filter' data-api-attr='{"filter_type":"prefilter"}' href="#">{{ lang.mailbox.set_prefilter }}</a></li>
          <li><a data-action="edit_selected" data-id="filter_item" data-api-url='edit/filter' data-api-attr='{"filter_type":"postfilter"}' href="#">{{ lang.mailbox.set_postfilter }}</a></li>
          <li role="separator" class="divider"></li>
          <li><a data-action="delete_selected" data-text="{{ lang.user.eas_reset }}?" data-id="filter_item" data-api-url='delete/filter' href="#">{{ lang.mailbox.remove }}</a></li>
        </ul>
        <div class="clearfix visible-xs"></div>
        <a class="btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" href="#" data-toggle="modal" data-target="#addFilterModalAdmin"><i class="bi bi-plus-lg"></i> {{ lang.mailbox.add_filter }}</a>
      </div>
    </div>
    <div class="panel-body{% if mailcow_cc_role != 'admin' %} hidden{% endif %}">
    <div class="row">
      <div class="col-lg-6">
        <h5>Global Prefilter</h5>
        <form class="form-horizontal" data-cached-form="false" role="form" data-id="add_prefilter">
          <div class="form-group">
            <div class="col-sm-12">
              <textarea autocorrect="off" spellcheck="false" autocapitalize="none" class="form-control textarea-code script_data" rows="10" name="script_data" required>{{ global_filters.prefilter }}</textarea>
            </div>
          </div>
          <div class="form-group">
            <div class="col-sm-10 add_filter_btns">
              <div class="btn-group">
                <button class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default validate_sieve" href="#">{{ lang.add.validate }}</button>
                <button class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success add_sieve_script" data-action="add_item" data-id="add_prefilter" data-api-url='add/global-filter' data-api-attr='{"filter_type":"prefilter"}' href="#" disabled><i class="bi bi-check-lg"></i> {{ lang.admin.save }}</button>
                <div class="clearfix visible-xs"></div>
              </div>
            </div>
          </div>
        </form>
      </div>
      <div class="col-lg-6">
        <h5>Global Postfilter</h5>
        <form class="form-horizontal" data-cached-form="false" role="form" data-id="add_postfilter">
          <div class="form-group">
            <div class="col-sm-12">
              <textarea autocorrect="off" spellcheck="false" autocapitalize="none" class="form-control textarea-code script_data" rows="10" name="script_data" required>{{ global_filters.postfilter }}</textarea>
            </div>
          </div>
          <div class="form-group">
            <div class="col-sm-10 add_filter_btns">
              <div class="btn-group">
                <button class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default validate_sieve" href="#">{{ lang.add.validate }}</button>
                <button class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success add_sieve_script" data-action="add_item" data-id="add_postfilter" data-api-url='add/global-filter' data-api-attr='{"filter_type":"postfilter"}' href="#" disabled><i class="bi bi-check-lg"></i> {{ lang.admin.save }}</button>
                <div class="clearfix visible-xs"></div>
              </div>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
  </div>
</div>
