diff --git a/pycsw/ogc/api/templates/item.html b/pycsw/ogc/api/templates/item.html index 4ea7fca39..31e1f8415 100644 --- a/pycsw/ogc/api/templates/item.html +++ b/pycsw/ogc/api/templates/item.html @@ -1,5 +1,5 @@ {% extends "_base.html" %} -{% block title %}{{ super() }} {{ data['id'] }} {% endblock %} +{% block title %}{{ data.get('properties',{}).get('title',data['id']) }} - {{ super() }}{% endblock %} {% block extrahead %} @@ -22,10 +22,15 @@ {% block body %}
- -

{{ data['id'] }}

-
+
+
+ {{ data.get('properties',{}).get('type','') | capitalize }} +

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

+

{{ data.get('properties',{}).get('description','') }}

+
+
+
@@ -41,74 +46,76 @@

{{ data['id'] }}

{% if 'properties' in data %} {% for key, value in data['properties'].items() %} - - {{ key }} - {% if key == 'keywords' %} - -
    - {% for keyword in value %} -
  • {{ keyword }}
  • - {% endfor %} -
- + {% if key not in ['title', 'description', 'type'] %} + + {{ key }} + {% if key == 'keywords' %} + +
    + {% for keyword in value %} +
  • {{ keyword }}
  • + {% endfor %} +
+ - {% elif key == 'themes' %} - - {% for theme in value %} - {{ theme['scheme'] }} - - {% endfor %} - - {% elif key == 'externalIds' %} - -
    - {% for id in value %} -
  • {{ id['scheme'] | urlize }} {{ id['value'] | urlize }}
  • + {% elif key == 'themes' %} + + {% for theme in value %} + {{ theme['scheme'] }} + - - {% elif key == 'providers' %} - - {% for cnt in data['properties']['providers'] %} - {% if 'name' in cnt and cnt['name'] not in [None,''] %} - {{ cnt['name'] }}
    - {% endif %} - {% if 'roles' in cnt and cnt['roles'] is not string %} - Role: {{ cnt['roles'] | map(attribute='name') | join(',') }}
    - {% endif %} - {% if 'positionName' in cnt and cnt['positionName'] not in [None,''] %} - Position: {{ cnt['positionName'] }})
    - {% endif %} - {% if 'contactInfo' in cnt and cnt['contactInfo'] is not string %} - {% for k,e in cnt['contactInfo'].get('phone',{}).items() %} - {% if e %}{{ k }}: {{ e }}
    {% endif %} - {% endfor %} - {% for k,e in cnt['contactInfo'].get('email',{}).items() %} - {% if e not in [None,''] %}{{ k }}: {{ e | urlize }}
    {% endif %} - {% endfor %} - {% for k,e in cnt['contactInfo'].get('address',{}).items() %} - {{ k }}: {% for a,b in e.items() %}{% if b %}{{ b }}, {% endif %}{% endfor %}
    +
+ {% endfor %} + + {% elif key == 'externalIds' %} + +
    + {% for id in value %} +
  • {{ id['scheme'] | urlize }} {{ id['value'] | urlize }}
  • {% endfor %} - {% if cnt['contactInfo']['url'] %} - {{ cnt['contactInfo']['url'].get('href','') | urlize }} +
+ + {% elif key == 'providers' %} + + {% for cnt in data['properties']['providers'] %} + {% if 'name' in cnt and cnt['name'] not in [None,''] %} + {{ cnt['name'] }}
{% endif %} - {% endif %} - {% endfor %} - - {% else %} - {{ value }} - {% endif %} - + {% if 'roles' in cnt and cnt['roles'] is not string %} + Role: {{ cnt['roles'] | map(attribute='name') | join(',') }}
+ {% endif %} + {% if 'positionName' in cnt and cnt['positionName'] not in [None,''] %} + Position: {{ cnt['positionName'] }})
+ {% endif %} + {% if 'contactInfo' in cnt and cnt['contactInfo'] is not string %} + {% for k,e in cnt['contactInfo'].get('phone',{}).items() %} + {% if e %}{{ k }}: {{ e }}
{% endif %} + {% endfor %} + {% for k,e in cnt['contactInfo'].get('email',{}).items() %} + {% if e not in [None,''] %}{{ k }}: {{ e | urlize }}
{% endif %} + {% endfor %} + {% for k,e in cnt['contactInfo'].get('address',{}).items() %} + {{ k }}: {% for a,b in e.items() %}{% if b %}{{ b }}, {% endif %}{% endfor %}
+ {% endfor %} + {% if cnt['contactInfo']['url'] %} + {{ cnt['contactInfo']['url'].get('href','') | urlize }} + {% endif %} + {% endif %} + {% endfor %} + + {% else %} + {{ value }} + {% endif %} + + {% endif%} {% endfor %} {% endif%} {% if data['time'] %}