blob: aa148955e4f001f52a39445eb98f4d361be7173e [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}}",
Patrick Williamsc124f4f2015-09-15 14:41:29 -050015 };
16
17 try {
18 tableInit(ctx);
19 } catch (e) {
20 document.write("Problem loading table widget: " + e);
21 }
22 })();
23 });
24</script>
25
26{% include 'toastertable-filter.html' %}
27
Patrick Williamsc0f7c042017-02-23 20:41:17 -060028<div class="row-fluid" id="empty-state-{{table_name}}" style="display:none">
29 <div class="alert alert-info">{{empty_state|safe}}</div>
30</div>
31
32<div id="no-results-{{table_name}}" style="display:none">
33 <div class="alert alert-warning">
34 <form class="form-inline">
35 <div class="form-group">
36 <div class="btn-group">
37 <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%}"/>
38 <span class="remove-search-btn-{{table_name}} glyphicon glyphicon-remove-circle" tabindex="-1"></a>
39 </div>
40 </div>
41 <button class="btn btn-default search-submit-{{table_name}}">
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050042 Search
43 </button>
44 <button class="btn btn-link show-all-{{table_name}} remove-search-btn-{{table_name}}">
45 Show all
Patrick Williamsc124f4f2015-09-15 14:41:29 -050046 </button>
47 </form>
48 </div>
49</div>
50
51<div id="table-container-{{table_name}}" style="visibility: hidden">
52 <!-- control header -->
Patrick Williamsc0f7c042017-02-23 20:41:17 -060053 <div class="navbar navbar-default" id="table-chrome-{{table_name}}">
54 <div class="container-fluid">
55 <div class="navbar-header">
56 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#table-chrome-collapse-{{table_name}}" aria-expanded="false">
57 <span class="sr-only">Toggle navigation</span>
58 <span class="icon-bar"></span>
59 <span class="icon-bar"></span>
60 <span class="icon-bar"></span>
61 </button>
Patrick Williamsc124f4f2015-09-15 14:41:29 -050062 </div>
Patrick Williamsc0f7c042017-02-23 20:41:17 -060063 <div class="collapse navbar-collapse" id="table-chrome-collapse-{{table_name}}">
64 <form class="navbar-form navbar-left">
65 <div class="form-group">
66 <div class="btn-group">
67 <input id="search-input-{{table_name}}" class="form-control" name="search" type="text" placeholder="Search {{title|lower}}" value="{%if request.GET.search%}{{request.GET.search}}{%endif%}"/>
68 <span class="remove-search-btn-{{table_name}} glyphicon glyphicon-remove-circle" tabindex="-1" style="display:none;">
69 </div>
70 </div>
71 <button class="btn btn-default" id="search-submit-{{table_name}}" >Search</button>
72 </form>
73 <form class="navbar-form navbar-right">
74 <div clas="form-group">
75 <label>Show rows:</label>
76 <select class="form-control pagesize-{{table_name}}">
77 {% with "10 25 50 100 150" as list%}
78 {% for i in list.split %}
79 <option value="{{i}}">{{i}}</option>
80 {% endfor %}
81 {% endwith %}
82 </select>
83 </div>
84 </form>
85 <div class="btn-group navbar-right">
86 <button id="edit-columns-button" class="btn btn-default navbar-btn dropdown-toggle" data-toggle="dropdown">Edit columns
Patrick Williamsc124f4f2015-09-15 14:41:29 -050087 <span class="caret"></span>
88 </button>
89 <ul class="dropdown-menu editcol">
90 </ul>
91 </div>
Patrick Williamsc124f4f2015-09-15 14:41:29 -050092 </div>
93 </div>
94 </div>
95
96 <!-- The actual table -->
Patrick Williamsc0f7c042017-02-23 20:41:17 -060097 <div class="table-responsive">
98 <table class="table table-bordered table-hover" id="{{table_name}}">
99 <thead>
100 <tr><th></th></tr>
101 </thead>
102 <tbody></tbody>
103 </table>
104 </div>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500105
106 <!-- Pagination controls -->
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600107 <div id="pagination-{{table_name}}">
108 <ul class="pagination">
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500109 </ul>
110
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600111 <form class="navbar-form navbar-right">
112 <div class="form-group">
113 <label>Show rows:</label>
114 <select class="form-control pagesize-{{table_name}}">
115 {% with "10 25 50 100 150" as list%}
116 {% for i in list.split %}
117 <option value="{{i}}">{{i}}</option>
118 {% endfor %}
119 {% endwith %}
120 </select>
121 </div>
122 </form>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500123 </div>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600124
125</div> <!--end table container -->