Skip to content

Commit 3442513

Browse files
authored
Merge pull request #22 from GeoscienceAustralia/develop
Develop
2 parents b206528 + 3b2d8bc commit 3442513

File tree

1 file changed

+5
-49
lines changed

1 file changed

+5
-49
lines changed

pygeoapi/templates/collections/items/index.html

Lines changed: 5 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@
1616
<link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster/dist/MarkerCluster.css"/>
1717
<link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster/dist/MarkerCluster.Default.css"/>
1818
<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">
2519
{% endblock %}
2620

2721
{% block body %}
@@ -83,35 +77,23 @@ <h1>{% for l in data['links'] if l.rel == 'collection' %} {{ l['title'] }} {% en
8377

8478
<div class="col-sm-12 col-md-6" style="overflow-x: scroll;">
8579
{% set props = [] %}
86-
<table id="searchtable" class="stripe cell-border order-column" style="width:100%">
80+
<table class="table table-striped table-bordered">
8781
<thead>
8882
<tr>
8983
{% if data.get('uri_field') %}
9084
{% 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>
9586
{% elif data.get('title_field') %}
9687
{% 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>
10189
{% else %}
102-
<th>
103-
<label> id </label>
104-
<div> id </div>
105-
</th>
90+
<th>id</th>
10691
{% endif %}
10792

10893
{% for k in data['features'][0]['properties'].keys() %}
10994
{% if k not in [data.id_field, data.title_field, data.uri_field, 'extent'] %}
11095
{% set props = props.append(k) %}
111-
<th>
112-
<label> {{ k }} </label>
113-
<div> {{ k }} </div>
114-
</th>
96+
<th>{{ k | striptags }}</th>
11597
{% endif %}
11698
{% endfor %}
11799
</tr>
@@ -159,32 +141,6 @@ <h1>{% for l in data['links'] if l.rel == 'collection' %} {{ l['title'] }} {% en
159141
</div>
160142
{% endif %}
161143
</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>
188144
{% endblock %}
189145

190146
{% block extrafoot %}

0 commit comments

Comments
 (0)