summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/bldviewer/templates/basetable.html
blob: 16628eafbeee5607ca94696743331fdb58b3eaa8 (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
{% extends "base.html" %}

{% block pagecontent %}
<script>
function showhideTableColumn(i, sh) {
    if (sh)
        $('td:nth-child('+i+'),th:nth-child('+i+')').show();
    else
        $('td:nth-child('+i+'),th:nth-child('+i+')').hide();
}


function filterTableRows(test) {
    if (test.length > 0) {
        var r = test.split(/[ ,]+/).map(function (e) { return new RegExp(e, 'i') });
        $('tr.data').map( function (i, el) {
            (! r.map(function (j) { return j.test($(el).html())}).reduce(function (c, p) { return c && p;} )) ? $(el).hide() : $(el).show();
        });
    } else
    {
        $('tr.data').show();
    }
}
</script>
<div style="margin-bottom: 0.5em">

    {% block pagename %}
    {% endblock %}
    <div align="left" style="display:inline-block; width: 40%; margin-left: 2em"> Filter: <input type="search" id="filterstring" style="width: 80%" onkeyup="filterTableRows($('#filterstring').val())" autocomplete="off">
    </div>
    {% if hideshowcols %}
    <div align="right" style="display: inline-block; width: 40%">Show/Hide columns:
    {% for i in hideshowcols %}
        <span>{{i.name}} <input type="checkbox" id="ct{{i.name}}" onchange="showhideTableColumn({{i.order}}, $('#ct{{i.name}}').is(':checked'))" checked autocomplete="off"></span> |
    {% endfor %}
    </div>
    {% endif %}
</div>

   <div style="display: block; float:right; margin-left: auto; margin-right:5em"><span class="pagination" style="vertical-align: top; margin-right: 3em">Showing {{objects.start_index}} to {{objects.end_index}} out of {{objects.paginator.count}} entries.&nbsp;</span>
   <ul class="pagination" style="display: block-inline">
{%if objects.has_previous %}
  <li><a href="?page={{objects.previous_page_number}}">&laquo;</a></li>
{%else%}
  <li class="disabled"><a href="#">&laquo;</a></li>
{%endif%}
{% for i in objects.page_range %}
  <li{%if i == objects.number %} class="active" {%endif%}><a href="?page={{i}}">{{i}}</a></li>
{% endfor %}
{%if objects.has_next%}
  <li><a href="?page={{objects.next_page_number}}">&raquo;</a></li>
{%else%}
  <li class="disabled"><a href="#">&raquo;</a></li>
{%endif%}
  </ul>
</div>

    <table class="table table-striped table-condensed" style="width:95%">
{% block pagetable %}
{% endblock %}
    </table>
</div>

{% endblock %}