Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 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 class="row-fluid" id="no-results-{{table_name}}" style="display:none"> |
| 30 | <div class="alert"> |
| 31 | <form class="no-results input-append"> |
| 32 | <input class="input-xxlarge" id="new-search-input-{{table_name}}" name="search" type="text" placeholder="Search {{title|lower}}" value="{%if request.GET.search %}{{request.GET.search}}{%endif%}"/> |
| 33 | <a href="#" class="add-on btn remove-search-btn-{{table_name}}" tabindex="-1"> |
| 34 | <i class="icon-remove"></i> |
| 35 | </a> |
| 36 | <button class="btn search-submit-{{table_name}}" >Search</button> |
| 37 | <button class="btn btn-link remove-search-btn-{{table_name}}">Show {{title|lower}} |
| 38 | </button> |
| 39 | </form> |
| 40 | </div> |
| 41 | </div> |
| 42 | |
| 43 | <div id="table-container-{{table_name}}" style="visibility: hidden"> |
| 44 | <!-- control header --> |
| 45 | <div class="navbar" id="table-chrome-{{table_name}}"> |
| 46 | <div class="navbar-inner"> |
| 47 | <div class="navbar-search input-append pull-left"> |
| 48 | |
| 49 | <input class="input-xxlarge" id="search-input-{{table_name}}" name="search" type="text" placeholder="Search {{title|lower}}" value="{%if request.GET.search%}{{request.GET.search}}{%endif%}"/> |
| 50 | <a href="#" style="display:none" class="add-on btn remove-search-btn-{{table_name}}" tabindex="-1"> |
| 51 | <i class="icon-remove"></i> |
| 52 | </a> |
| 53 | <button class="btn" id="search-submit-{{table_name}}" >Search</button> |
| 54 | </div> |
| 55 | |
| 56 | <div class="pull-right"> |
| 57 | <div class="btn-group"> |
| 58 | <button class="btn dropdown-toggle" data-toggle="dropdown">Edit columns |
| 59 | <span class="caret"></span> |
| 60 | </button> |
| 61 | <ul class="dropdown-menu editcol"> |
| 62 | </ul> |
| 63 | </div> |
| 64 | <div style="display:inline"> |
| 65 | <span class="divider-vertical"></span> |
| 66 | <span class="help-inline" style="padding-top:5px;">Show rows:</span> |
| 67 | <select style="margin-top:5px;margin-bottom:0px;" class="pagesize-{{table_name}}"> |
| 68 | {% with "10 25 50 100 150" as list%} |
| 69 | {% for i in list.split %} |
| 70 | <option value="{{i}}">{{i}}</option> |
| 71 | {% endfor %} |
| 72 | {% endwith %} |
| 73 | </select> |
| 74 | </div> |
| 75 | </div> |
| 76 | </div> |
| 77 | </div> |
| 78 | |
| 79 | <!-- The actual table --> |
| 80 | <table class="table table-bordered table-hover tablesorter" id="{{table_name}}"> |
| 81 | <thead> |
| 82 | <tr><th></th></tr> |
| 83 | </thead> |
| 84 | <tbody></tbody> |
| 85 | </table> |
| 86 | |
| 87 | <!-- Pagination controls --> |
| 88 | <div class="pagination pagination-centered" id="pagination-{{table_name}}"> |
| 89 | <ul class="pagination" style="display: block-inline"> |
| 90 | </ul> |
| 91 | |
| 92 | <div class="pull-right"> |
| 93 | <span class="help-inline" style="padding-top:5px;">Show rows:</span> |
| 94 | <select style="margin-top:5px;margin-bottom:0px;" class="pagesize-{{table_name}}"> |
| 95 | {% with "10 25 50 100 150" as list%} |
| 96 | {% for i in list.split %} |
| 97 | <option value="{{i}}">{{i}}</option> |
| 98 | {% endfor %} |
| 99 | {% endwith %} |
| 100 | </select> |
| 101 | </div> |
| 102 | </div> |
| 103 | </div> |