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 }; 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 28<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}}"> 42 Search 43 </button> 44 <button class="btn btn-link show-all-{{table_name}} remove-search-btn-{{table_name}}"> 45 Show all 46 </button> 47 </form> 48 </div> 49</div> 50 51<div id="table-container-{{table_name}}" style="visibility: hidden"> 52 <!-- control header --> 53 <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> 62 </div> 63 <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 87 <span class="caret"></span> 88 </button> 89 <ul class="dropdown-menu editcol"> 90 </ul> 91 </div> 92 </div> 93 </div> 94 </div> 95 96 <!-- The actual table --> 97 <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> 105 106 <!-- Pagination controls --> 107 <div id="pagination-{{table_name}}"> 108 <ul class="pagination"> 109 </ul> 110 111 <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> 123 </div> 124 125</div> <!--end table container --> 126