12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- {% 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 %}
|