summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/blocks/DataTables-content.html
blob: 82da411e1512a8a84c7d47ca6792b5d8c896ec72 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{% load i18n %}
    <div id="grid_{{name}}_meta_wrapper">
        <table id='grid_{{name}}' class="display" width="100%">
            <thead>
            <tr>
                <th></th>
                <th></th>{% for col in col_names %}
                <th>{{col}}</th>
            {% endfor %}</tr>
            </thead>
        </table>
    </div>

    <div id='foot_{{name}}' class="gridfooter row toolbar">
        <div class='col col-sm-2'>
            <div class="btn-group btn-group-sm" role="group">
                <button type='button' class="btn btn-secondary" data-toggle="modal"
                        data-target="#modal_grid_{{name}}">
                    {% trans "Expand table" %} <i class="fa fa-expand" aria-hidden="true"></i>
                </button>
            </div>
        </div>
        <div class="col">
            <div class="btn-group btn-group-sm" role="group">
                  <button id="export-{{name}}" type="button"
                          class="btn btn-secondary dropdown-toggle" data-toggle="dropdown"
                          aria-haspopup="true" aria-expanded="false">
                    {% trans 'Export'%}
                  </button>
                  <div class="dropdown-menu" aria-labelledby="export-{{name}}">
                    {% if source_full or extra_sources %}
                    <a class="dropdown-item {{sname}}-csv" href='{{source}}csv' target='_blank'
                    title="{% trans 'Export as CSV - ' %}{% trans 'simple'%}">{% trans "Simple CSV" %}</a>
                    {% if source_full %}<a class='dropdown-item {{sname}}-csv-full' href='{{source_full}}csv' target='_blank' title="{% trans 'Export as CSV - full' %}">{% trans "CSV full" %}</a>{% endif %}
                    {% for slug, name, extra_source in extra_sources %}
                    <a class="dropdown-item {{slug}}-csv-full" href='{{extra_source}}csv' target='_blank' title="{% trans 'Export as CSV - ' %}{{name}}">{{name}}</a>
                    {% endfor %}
                    {% else %}
                    <a class="dropdown-item {{sname}}-csv" href="{{source}}csv" target="_blank" title="{% trans 'Export as CSV' %}">{% trans "CSV" %}</a>
                    {% endif %}
                  </div>
            </div>
            {% if current_model.has_label_templates %}<div class="btn-group btn-group-sm" role="group">
                  <button id="export-labels-{{name}}" type="button"
                          class="btn btn-secondary dropdown-toggle" data-toggle="dropdown"
                          aria-haspopup="true" aria-expanded="false">
                    {% trans 'Labels'%}
                  </button>
                  <div class="dropdown-menu" aria-labelledby="export-labels-{{name}}">
                  {% for template in current_model.label_templates %}
                    <a class="dropdown-item {{template.slug}}-labels" href="{{template.get_baselink_for_labels}}" target="_blank" title="{{template.name}}">
                        {{template.name}}
                    </a>
                  {% endfor %}
                  </div>
            </div>{% endif %}
        </div>
    </div>

    {% if multiple %}
    <input type="button" id="add_button_{{name}}" value="{% trans 'Add' %}"/>
    <ul id="selectmulti_{{name}}" class="selectmulti"></ul>
    {% endif %}

    <input type="hidden" id="hidden_{{name}}" name="{{name}}"/>