From 491ceaff48caeed0e5533d7df37140b3cce9bba8 Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Fri, 2 Aug 2024 09:07:47 -0400 Subject: [PATCH] fix collection breadcrumbs on queryables and schemas HTML Jinja2 templates (#1769) --- pygeoapi/api/__init__.py | 1 + pygeoapi/api/itemtypes.py | 1 + pygeoapi/templates/collections/queryables.html | 2 +- pygeoapi/templates/collections/schema.html | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pygeoapi/api/__init__.py b/pygeoapi/api/__init__.py index 65d8558..297a22d 100644 --- a/pygeoapi/api/__init__.py +++ b/pygeoapi/api/__init__.py @@ -1382,6 +1382,7 @@ class API: self.config['resources'][dataset]['title'], request.locale) schema['collections_path'] = self.get_collections_url() + schema['dataset_path'] = f'{self.get_collections_url()}/{dataset}' content = render_j2_template(self.tpl_config, 'collections/schema.html', diff --git a/pygeoapi/api/itemtypes.py b/pygeoapi/api/itemtypes.py index 1fa70c2..c2f4035 100644 --- a/pygeoapi/api/itemtypes.py +++ b/pygeoapi/api/itemtypes.py @@ -188,6 +188,7 @@ def get_collection_queryables(api: API, request: Union[APIRequest, Any], api.config['resources'][dataset]['title'], request.locale) queryables['collections_path'] = api.get_collections_url() + queryables['dataset_path'] = f'{api.get_collections_url()}/{dataset}' content = render_j2_template(api.tpl_config, 'collections/queryables.html', diff --git a/pygeoapi/templates/collections/queryables.html b/pygeoapi/templates/collections/queryables.html index df43871..49ca148 100644 --- a/pygeoapi/templates/collections/queryables.html +++ b/pygeoapi/templates/collections/queryables.html @@ -2,7 +2,7 @@ {% block title %}{{ super() }} {{ data['title'] }} {% endblock %} {% block crumbs %}{{ super() }} / {% trans %}Collections{% endtrans %} -/ {{ data['title'] | truncate( 25 ) }} +/ {{ data['title'] | truncate( 25 ) }} / {% trans %}Queryables{% endtrans %} {% endblock %} {% block body %} diff --git a/pygeoapi/templates/collections/schema.html b/pygeoapi/templates/collections/schema.html index e839d36..f83f42f 100644 --- a/pygeoapi/templates/collections/schema.html +++ b/pygeoapi/templates/collections/schema.html @@ -2,7 +2,7 @@ {% block title %}{{ super() }} {{ data['title'] }} {% endblock %} {% block crumbs %}{{ super() }} / {% trans %}Collections{% endtrans %} -/ {{ data['title'] | truncate( 25 ) }} +/ {{ data['title'] | truncate( 25 ) }} / {% trans %}Schema{% endtrans %} {% endblock %} {% block body %}