summaryrefslogtreecommitdiff
path: root/horizon/templates/horizon/common/_data_table_table_actions.html
blob: 44b43f6749b40b39dc2b9fa9d53e02d74dc3ad84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{% 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-small{% ifequal button.value filter.filter_string %} active{% endifequal %}">{% if button.icon %}<i class="{{ button.icon }}"></i> {% endif %}{{ button.text }}{% if button.count >= 0 %} ({{ button.count }}){% endif %}</button>
        {% endfor %}
    </div>
    {% elif filter.filter_type == 'query' %}
    <div class="table_search">
        <input class="span3 example" 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 %}
        {% if action != filter %}
            {% if action.method != "GET" %}
                <button {{ action.attr_string|safe }} name="action" value="{{ action.get_param_name }}" type="submit">{% if action.handles_multiple %}{{ action.verbose_name_plural }}{% else %}{{ action.verbose_name }}{% endif %}</button>
            {% else %}
                <a href='{{ action.get_link_url }}' title='{{ action.verbose_name }}' {{ action.attr_string|safe }}>{{ action.verbose_name }}</a>
            {% endif %}
        {% endif %}
    {% endfor %}
    </div>
{% endblock table_actions %}