|
16 | 16 | <link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster/dist/MarkerCluster.css"/>
|
17 | 17 | <link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster/dist/MarkerCluster.Default.css"/>
|
18 | 18 | <script src="https://unpkg.com/leaflet.markercluster/dist/leaflet.markercluster-src.js"></script>
|
19 |
| - <script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script> |
20 |
| - <link rel="stylesheet" href="https://cdn.datatables.net/2.0.3/css/dataTables.dataTables.css" /> |
21 |
| - <script type="text/javascript" src="https://cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js"></script> |
22 |
| - <script type="text/javascript" src="https://cdn.datatables.net/fixedcolumns/3.3.2/js/dataTables.fixedColumns.min.js"></script> |
23 |
| - <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.24/css/jquery.dataTables.min.css"> |
24 |
| - <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/fixedcolumns/3.3.2/css/fixedColumns.dataTables.min.css"> |
25 | 19 | {% endblock %}
|
26 | 20 |
|
27 | 21 | {% block body %}
|
@@ -83,35 +77,23 @@ <h1>{% for l in data['links'] if l.rel == 'collection' %} {{ l['title'] }} {% en
|
83 | 77 |
|
84 | 78 | <div class="col-sm-12 col-md-6" style="overflow-x: scroll;">
|
85 | 79 | {% set props = [] %}
|
86 |
| - <table id="searchtable" class="stripe cell-border order-column" style="width:100%"> |
| 80 | + <table class="table table-striped table-bordered"> |
87 | 81 | <thead>
|
88 | 82 | <tr>
|
89 | 83 | {% if data.get('uri_field') %}
|
90 | 84 | {% set uri_field = data.uri_field %}
|
91 |
| - <th> |
92 |
| - <label> {{uri_field}} </label> |
93 |
| - <div> {{uri_field}} </div> |
94 |
| - </th> |
| 85 | + <th>{{ uri_field }}</th> |
95 | 86 | {% elif data.get('title_field') %}
|
96 | 87 | {% set title_field = data.title_field %}
|
97 |
| - <th> |
98 |
| - <label> {{ title_field }} </label> |
99 |
| - <div> {{ title_field }} </div> |
100 |
| - </th> |
| 88 | + <th>{{ title_field }}</th> |
101 | 89 | {% else %}
|
102 |
| - <th> |
103 |
| - <label> id </label> |
104 |
| - <div> id </div> |
105 |
| - </th> |
| 90 | + <th>id</th> |
106 | 91 | {% endif %}
|
107 | 92 |
|
108 | 93 | {% for k in data['features'][0]['properties'].keys() %}
|
109 | 94 | {% if k not in [data.id_field, data.title_field, data.uri_field, 'extent'] %}
|
110 | 95 | {% set props = props.append(k) %}
|
111 |
| - <th> |
112 |
| - <label> {{ k }} </label> |
113 |
| - <div> {{ k }} </div> |
114 |
| - </th> |
| 96 | + <th>{{ k | striptags }}</th> |
115 | 97 | {% endif %}
|
116 | 98 | {% endfor %}
|
117 | 99 | </tr>
|
@@ -159,32 +141,6 @@ <h1>{% for l in data['links'] if l.rel == 'collection' %} {{ l['title'] }} {% en
|
159 | 141 | </div>
|
160 | 142 | {% endif %}
|
161 | 143 | </section>
|
162 |
| - <script> |
163 |
| - $(document).ready(function() { |
164 |
| - // Setup - add a text input to each header cell |
165 |
| - $('#searchtable thead th div').each(function(i) { |
166 |
| - var title = $('#searchtable thead th div').eq($(this).index()).text(); |
167 |
| - $(this).html('<input type="text" placeholder="Search ' + '" data-index="' + i + '" />'); |
168 |
| - }); |
169 |
| - |
170 |
| - // DataTable |
171 |
| - var table = $('#searchtable').DataTable({ |
172 |
| - responsive: true, |
173 |
| - paging: true, |
174 |
| - sorting: false, |
175 |
| - searching: true, |
176 |
| - //dom: 'rtip', //this can be used to remove the search bar at the top and other configuration settings |
177 |
| - }); |
178 |
| - |
179 |
| - // Filter event handler |
180 |
| - $(table.table().container()).on('keyup', 'thead input', function() { |
181 |
| - table |
182 |
| - .column($(this).data('index')) |
183 |
| - .search(this.value) |
184 |
| - .draw(); |
185 |
| - }); |
186 |
| - }); |
187 |
| - </script> |
188 | 144 | {% endblock %}
|
189 | 145 |
|
190 | 146 | {% block extrafoot %}
|
|
0 commit comments