blob: 083bcb82e9e580bacc4107d8988b59fa8630f935 (
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
|
{% 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"> Search: <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>
<table class="table table-striped table-condensed" style="width:95%">
{% block pagetable %}
{% endblock %}
</table>
</div>
{% endblock %}
|