Skip to content

Commit

Permalink
fix collection breadcrumbs on queryables and schemas HTML Jinja2 temp…
Browse files Browse the repository at this point in the history
…lates (#1769)
  • Loading branch information
tomkralidis authored Aug 2, 2024
1 parent d1dfa17 commit 491ceaf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions pygeoapi/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1382,6 +1382,7 @@ def get_collection_schema(self, request: Union[APIRequest, Any],
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',
Expand Down
1 change: 1 addition & 0 deletions pygeoapi/api/itemtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion pygeoapi/templates/collections/queryables.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% block title %}{{ super() }} {{ data['title'] }} {% endblock %}
{% block crumbs %}{{ super() }}
/ <a href="{{ data['collections_path'] }}">{% trans %}Collections{% endtrans %}</a>
/ <a href="./{{ data['id'] }}">{{ data['title'] | truncate( 25 ) }}</a>
/ <a href="{{ data['dataset_path'] }}">{{ data['title'] | truncate( 25 ) }}</a>
/ <a href="./{{ data['id'] }}queryables">{% trans %}Queryables{% endtrans %}</a>
{% endblock %}
{% block body %}
Expand Down
2 changes: 1 addition & 1 deletion pygeoapi/templates/collections/schema.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% block title %}{{ super() }} {{ data['title'] }} {% endblock %}
{% block crumbs %}{{ super() }}
/ <a href="{{ data['collections_path'] }}">{% trans %}Collections{% endtrans %}</a>
/ <a href="./{{ data['id'] }}">{{ data['title'] | truncate( 25 ) }}</a>
/ <a href="{{ data['dataset_path'] }}">{{ data['title'] | truncate( 25 ) }}</a>
/ <a href="./{{ data['id'] }}schema">{% trans %}Schema{% endtrans %}</a>
{% endblock %}
{% block body %}
Expand Down

0 comments on commit 491ceaf

Please sign in to comment.