{% load i18n %}
<div class="table_actions clearfix">
{% block table_filter %}
  {% if filter.filter_type == 'fixed' %}
    <div class="table_filter btn-group" data-toggle="buttons-radio">
      {% for button in filter.fixed_buttons %}
        <button name="{{ filter.get_param_name }}" type="submit" value="{{ button.value }}" class="btn btn-default{% ifequal button.value filter.filter_string %} active{% endifequal %}">
          {% if button.icon %}
            <span class="fa {{ button.icon }}"></span>
          {% endif %}
          {{ button.text }}
          {% if button.count >= 0 %}
            ({{ button.count }})
          {% endif %}
        </button>
      {% endfor %}
    </div>
  {% elif filter.filter_type == 'query' %}
    <div class="table_search client">
      <div class="form-group has-feedback">
        <input class="form-control" value="{{ filter.filter_string|default:'' }}" type="text" name="{{ filter.get_param_name }}" placeholder="{% trans "Filter" %}"/>
        <span class="fa fa-search search-icon form-control-feedback"></span>
      </div>
    </div>
  {% elif filter.filter_type == 'server' %}
    <div class="table_search">
      <select name="{{ filter.get_param_name }}_field" class="form-control">
        {% for choice in filter.filter_choices %}
          <option value="{{ choice.0 }}" {% if choice.0 == filter.filter_field %} selected{% endif %}>{{ choice.1 }}</option>
        {% endfor %}
      </select>
      <input class="form-control" value="{{ filter.filter_string|default:'' }}" type="text" name="{{ filter.get_param_name }}" />
      <button type="submit" {{ filter.attr_string|safe }}>{% trans "Filter" %}</button>
    </div>
  {% endif %}
{% endblock table_filter %}
{% block table_actions %}
  {% for action in table_actions_buttons %}
    {%  include "horizon/common/_data_table_table_action.html" %}
  {% endfor %}
  {% if table_actions_menu|length > 0 %}
    <div class="btn-group table_actions_menu">
      <a class="btn btn-default dropdown-toggle" data-toggle="dropdown" href="#">
        {% if table_actions_buttons|length > 0 %}
          {% trans "More Actions" %}
        {% else %}
          {% trans "Actions" %}
        {% endif %}
        <span class="fa fa-caret-down"></span>
      </a>
      <ul class="dropdown-menu dropdown-menu-right">
      {% for action in table_actions_menu %}
        <li>
          {% include "horizon/common/_data_table_table_action.html" %}
        </li>
      {% endfor %}
      </ul>
    </div>
  {% endif %}
{% endblock table_actions %}
</div>
