1
2{% load static %}
3{% load projecttags %}
4
5<script src="{% static 'js/table.js' %}"></script>
6<script src="{% static 'js/layerBtn.js' %}"></script>
7<script>
8  $(document).ready(function() {
9    (function(){
10
11    var ctx = {
12      tableName : "{{table_name}}",
13      url : "{{ xhr_table_url }}?format=json",
14      title : "{{title}}",
15      projectLayers : {{projectlayers|json}},
16    };
17
18    try {
19      tableInit(ctx);
20    } catch (e) {
21      document.write("Problem loading table widget: " + e);
22    }
23    })();
24  });
25</script>
26
27{% include 'toastertable-filter.html' %}
28
29<div id="no-results-{{table_name}}" style="display:none">
30  <div class="alert alert-warning">
31    <form class="no-results form-inline">
32      <div class="form-group">
33        <div class="btn-group">
34          <input class="form-control" id="new-search-input-{{table_name}}" name="search" type="text" placeholder="Search {{title|lower}}" value="{% if request.GET.search %}{{request.GET.search}}{% endif %}"/>
35          <span class="remove-search-btn-{{table_name}} glyphicon glyphicon-remove-circle" tabindex="-1"></span>
36        </div>
37      </div>
38      <button class="btn btn-default search-submit-{{table_name}}">Search</button>
39      <button class="btn btn-link remove-search-btn-{{table_name}}">Show all {{title|lower}}</button>
40    </form>
41  </div>
42</div>
43<div id="table-container-{{table_name}}" style="visibility: hidden">
44  <!-- control header -->
45  <div id="table-chrome-{{table_name}}">
46    <div class="container-fluid detail-page-contols">
47      <form class="navbar-form navbar-left">
48        <div class="form-group">
49          <div class="btn-group">
50            <input class="form-control" id="search-input-{{table_name}}" name="search" type="text" placeholder="Search {{title|lower}}" value="{% if request.GET.search %}{{request.GET.search}}{% endif %}"/>
51            <span href="#" style="display:none" class="remove-search-btn-{{table_name}} glyphicon glyphicon-remove-circle" tabindex="-1"></span>
52          </div>
53        </div>
54        <button class="btn btn-default" id="search-submit-{{table_name}}" >Search</button>
55      </form>
56
57      <form class="navbar-form navbar-right">
58        <div class="form-group">
59          <label>Show rows:</label>
60          <select class="form-control pagesize-{{table_name}}">
61            {% with "10 25 50 100 150" as list%}
62            {% for i in list.split %}
63            <option value="{{i}}">{{i}}</option>
64            {% endfor %}
65            {% endwith %}
66          </select>
67        </div>
68      </form>
69    </div>
70  </div>
71
72  <!-- The actual table -->
73  <div class="table-responsive">
74    <table class="table table-bordered table-hover" id="{{table_name}}">
75      <thead>
76        <tr><th></th></tr>
77      </thead>
78      <tbody></tbody>
79    </table>
80  </div>
81
82  <!-- Pagination controls -->
83  <div id="pagination-{{table_name}}">
84    <ul class="pagination">
85    </ul>
86
87    <form class="navbar-form navbar-right">
88      <div class="form-group">
89        <label>Show rows:</label>
90        <select class="form-control pagesize-{{table_name}}">
91          {% with "10 25 50 100 150" as list%}
92          {% for i in list.split %}
93          <option value="{{i}}">{{i}}</option>
94          {% endfor %}
95          {% endwith %}
96        </select>
97      </div>
98    </form>
99  </div>
100</div>
101