blob: 56cd2ce37508ff843de516ab507b33a1d977dfa3 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001
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
Patrick Williamsc0f7c042017-02-23 20:41:17 -060029<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>
Patrick Williamsc124f4f2015-09-15 14:41:29 -050040 </form>
41 </div>
42</div>
43<div id="table-container-{{table_name}}" style="visibility: hidden">
44 <!-- control header -->
Patrick Williamsc0f7c042017-02-23 20:41:17 -060045 <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>
Patrick Williamsc124f4f2015-09-15 14:41:29 -050056
Patrick Williamsc0f7c042017-02-23 20:41:17 -060057 <form class="navbar-form navbar-right">
58 <div class="form-group">
59 <label>Show rows:</label>
60 <select class="form-control pagesize-{{table_name}}">
Patrick Williamsc124f4f2015-09-15 14:41:29 -050061 {% 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>
Patrick Williamsc0f7c042017-02-23 20:41:17 -060068 </form>
69 </div>
Patrick Williamsc124f4f2015-09-15 14:41:29 -050070 </div>
71
72 <!-- The actual table -->
Patrick Williamsc0f7c042017-02-23 20:41:17 -060073 <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>
Patrick Williamsc124f4f2015-09-15 14:41:29 -050081
82 <!-- Pagination controls -->
Patrick Williamsc0f7c042017-02-23 20:41:17 -060083 <div id="pagination-{{table_name}}">
84 <ul class="pagination">
Patrick Williamsc124f4f2015-09-15 14:41:29 -050085 </ul>
86
Patrick Williamsc0f7c042017-02-23 20:41:17 -060087 <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>
Patrick Williamsc124f4f2015-09-15 14:41:29 -050099 </div>
100</div>