🔧 if conditional is added to the collections section (#1226)

* 🔧 if conditional is added to the collections section

* 🔧 if conditional is added to the collections section

* ⬆️ add collection key in data
This commit is contained in:
IngenieroGeomatico
2023-04-25 19:36:39 +02:00
committed by GitHub
parent c46972dcf6
commit 70c59bcfc6
2 changed files with 7 additions and 0 deletions
+5
View File
@@ -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
+2
View File
@@ -43,12 +43,14 @@
</div>
</div>
</section>
{% if data['collection'] %}
<section id="collections">
<h2>{% trans %}Collections{% endtrans %}</h2>
<p>
<a href="{{ config['server']['url'] }}/collections?f=html">{% trans %}View the collections in this service{% endtrans %}</a>
</p>
</section>
{% endif %}
{% if data['stac'] %}
<section id="collections">
<h2>{% trans %}SpatioTemporal Assets{% endtrans %}</h2>