From 75738da0f31ba26a65ea4de053a41c2a03c71732 Mon Sep 17 00:00:00 2001 From: Paul van Genuchten Date: Tue, 17 Sep 2024 12:31:11 +0200 Subject: [PATCH] splits formats by `,` and improve display (#1015) resolves #1011 --- pycsw/ogc/api/records.py | 2 +- pycsw/ogc/api/templates/item.html | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pycsw/ogc/api/records.py b/pycsw/ogc/api/records.py index be3b76957..9049c2e78 100644 --- a/pycsw/ogc/api/records.py +++ b/pycsw/ogc/api/records.py @@ -1181,7 +1181,7 @@ def record2json(record, url, collection, mode='ogcapi-records'): record_dict['properties']['description'] = record.abstract if record.format: - record_dict['properties']['formats'] = [{'name': record.format}] + record_dict['properties']['formats'] = [{'name': f} for f in record.format.split(',') if len(f) > 1] if record.keywords: record_dict['properties']['keywords'] = [x for x in record.keywords.split(',')] diff --git a/pycsw/ogc/api/templates/item.html b/pycsw/ogc/api/templates/item.html index cf3bb9dc8..ce881aa63 100644 --- a/pycsw/ogc/api/templates/item.html +++ b/pycsw/ogc/api/templates/item.html @@ -48,7 +48,7 @@

{{ data.get('properties',{}).get('title',data['id']) }}

{% for key, value in data['properties'].items() %} {{ key | capitalize }} - {% if key == 'keywords' or key == 'formats' %} + {% if key == 'keywords' %} + {% elif key == 'formats' %} + + + {% elif key == 'themes' %} {% for theme in value %}