From 70c59bcfc6e707de8d4f294e4836113fe7c73c96 Mon Sep 17 00:00:00 2001
From: IngenieroGeomatico
<84268457+IngenieroGeomatico@users.noreply.github.com>
Date: Tue, 25 Apr 2023 19:36:39 +0200
Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20if=20conditional=20is=20added=20?=
=?UTF-8?q?to=20the=20collections=20section=20(#1226)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* :wrench: if conditional is added to the collections section
* :wrench: if conditional is added to the collections section
* :arrow_up: add collection key in data
---
pygeoapi/api.py | 5 +++++
pygeoapi/templates/landing_page.html | 2 ++
2 files changed, 7 insertions(+)
diff --git a/pygeoapi/api.py b/pygeoapi/api.py
index 7ea08dd..92ba518 100644
--- a/pygeoapi/api.py
+++ b/pygeoapi/api.py
@@ -764,6 +764,7 @@ class API:
fcm['processes'] = False
fcm['stac'] = False
+ fcm['collection'] = False
if filter_dict_by_key_value(self.config['resources'],
'type', 'process'):
@@ -773,6 +774,10 @@ class API:
'type', 'stac-collection'):
fcm['stac'] = True
+ if filter_dict_by_key_value(self.config['resources'],
+ 'type', 'collection'):
+ fcm['collection'] = True
+
content = render_j2_template(self.tpl_config, 'landing_page.html',
fcm, request.locale)
return headers, HTTPStatus.OK, content
diff --git a/pygeoapi/templates/landing_page.html b/pygeoapi/templates/landing_page.html
index 7bc0d2b..ab67398 100644
--- a/pygeoapi/templates/landing_page.html
+++ b/pygeoapi/templates/landing_page.html
@@ -43,12 +43,14 @@
+ {% if data['collection'] %}
+ {% endif %}
{% if data['stac'] %}
{% trans %}SpatioTemporal Assets{% endtrans %}