Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion pygeoapi/templates/collections/collection.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1>{{ data['title'] }}</h1>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="col-sm-12 mb-2">
<div id="collection-map"></div>
</div>
</div>
Expand Down Expand Up @@ -88,6 +88,23 @@ <h3>{% trans %}Tiles{% endtrans %}</h3>
{% endfor %}
{% endif %}

{%- if data['data_queries'] -%}
<h3>Data Queries</h3>
<table class="table table-striped table-bordered">
<tr>
<th>Query Name</th>
<th>Query Location</th>
</tr>
{% for query_name, query in data['data_queries'].items() %}
<tr>
<td>{{ query_name }}</td>
<td><a title="{{ query_name }}" href="{{ query['link']['href'] }}">{{ query['link']['href'] }}</a></td>
</tr>
{% endfor %}
<caption><em>Note: EDR Queries may require query parameters not provided in the Query Location.</em></caption>
</table>
{%- endif -%}

{% if 'parameter_names' in data %}
<h3>Parameters</h3>
<table class="table table-striped table-bordered">
Expand Down
3 changes: 2 additions & 1 deletion pygeoapi/templates/collections/edr/query.html
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@

var items = new L.GeoJSON(geojson_data, {
onEachFeature: function (feature, layer) {
var html = '<span>' + {% if data['title_field'] %} feature['properties']['{{ data['title_field'] }}'] {% else %} feature.id {% endif %} + '</span>';
var url = '{{ data['query_path'] }}/' + feature.id + '?f=html';
var html = '<span><a href="' + url + '">' + {% if data['title_field'] %} feature['properties']['{{ data['title_field'] }}'] {% else %} feature.id {% endif %} + '</a></span>';
layer.bindPopup(html);
}
});
Expand Down
12 changes: 12 additions & 0 deletions pygeoapi/templates/collections/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
/ <a href="{{ data['collections_path'] }}">{% trans %}Collections{% endtrans %}</a>
{% endblock %}
{% block body %}
{% set collections = namespace(data=false, records=false) %}
{% for col in data['collections'] %}
{% if col.get('itemType') == 'record' %}
{% set collections.records = true %}
{% else %}
{% set collections.data = true %}
{% endif %}
{% endfor %}
{% if collections.data %}
<section id="data-collections">
<h1>{% trans %}Data collections in this service{% endtrans %}</h1>
<table class="table table-striped table-bordered">
Expand Down Expand Up @@ -31,6 +40,8 @@ <h1>{% trans %}Data collections in this service{% endtrans %}</h1>
</tbody>
</table>
</section>
{% endif %}
{% if collections.records %}
<section id="record-collections">
<h1>{% trans %}Record collections in this service{% endtrans %}</h1>
<table class="table table-striped table-bordered">
Expand Down Expand Up @@ -58,4 +69,5 @@ <h1>{% trans %}Record collections in this service{% endtrans %}</h1>
</tbody>
</table>
</section>
{% endif %}
{% endblock %}
Loading