Skip to content

Commit

Permalink
Display numberMatched in HTML view (geopython#1797)
Browse files Browse the repository at this point in the history
* Display numberMatched in HTML view

* Fix display on no numberMatched

* Amend based on feedback
  • Loading branch information
webb-ben authored Aug 22, 2024
1 parent 7a3d8a8 commit 33b4ff7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pygeoapi/templates/collections/items/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<section id="items"></section>
<section id="collection">
<h1>{% for l in data['links'] if l.rel == 'collection' %} {{ l['title'] }} {% endfor %}</h1>
<p>{% trans %}Items in this collection{% endtrans %}.</p>
</section>
<section id="items">
{% if data['features'] %}
Expand All @@ -35,7 +34,9 @@ <h1>{% for l in data['links'] if l.rel == 'collection' %} {{ l['title'] }} {% en
<div class="col-sm-12">
<div class="row">
<div class="col-sm-12">
{% trans %}Warning: Higher limits not recommended!{% endtrans %}
{% if data['numberMatched'] %}
<p>{% trans %}Items in this collection{% endtrans %}: {{ data['numberMatched'] }}</p>
{% endif %}
</div>
</div>
<div class="row">
Expand All @@ -47,6 +48,7 @@ <h1>{% for l in data['links'] if l.rel == 'collection' %} {{ l['title'] }} {% en
<option value="1000">1,000</option>
<option value="2000">2,000</option>
</select>
<p>{% trans %}Warning: Higher limits not recommended!{% endtrans %}</p>
<script>
var select = document.getElementById('limits');
var defaultValue = select.getElementsByTagName('option')[0].value;
Expand Down Expand Up @@ -134,6 +136,12 @@ <h1>{% for l in data['links'] if l.rel == 'collection' %} {{ l['title'] }} {% en
</table>
</div>
</div>
{% elif data['numberMatched'] %}
<div class="row">
<div class="col-sm-12">
<p>{% trans %}Items in this collection{% endtrans %}: {{ data['numberMatched'] }}</p>
</div>
</div>
{% else %}
<div class="row col-sm-12">
<p>{% trans %}No items{% endtrans %}</p>
Expand Down

0 comments on commit 33b4ff7

Please sign in to comment.