{% extends "_base.html" %} {% set ptitle = data['properties'][data['title_field']] or data['id'] | string %} {% block desc %}{{ data.get('properties',{}).get('description', {}) | string | truncate(250) }}{% endblock %} {% block tags %}{{ data['properties'].get('themes', [{}])[0].get('concepts', []) | join(',') }}{% endblock %} {# Optionally renders an img element, otherwise standard value or link rendering #} {% macro render_item_value(v, width) -%} {% set val = v | string | trim %} {% if val|length and val.lower().endswith(('.jpg', '.jpeg', '.png', '.gif', '.bmp')) %} {# Ends with image extension: render img element with link to image #} {{ val.split('/') | last }} {% elif v is string or v is number %} {{ val | urlize() }} {% elif v is mapping %} {% for i,j in v.items() %} {{ i }}: {{ render_item_value(j, 60) }}
{% endfor %} {% elif v is iterable %} {% for i in v %} {{ render_item_value(i, 60) }} {% endfor %} {% else %} {{ val | urlize() }} {% endif %} {%- endmacro %} {% block title %}{{ ptitle }}{% endblock %} {% block crumbs %}{{ super() }} / {% trans %}Collections{% endtrans %} {% for link in data['links'] %} {% if link.rel == 'collection' %} / {{ link['title'] | truncate( 25 ) }} {% endif %} {% endfor %} / {% trans %}Items{% endtrans %} / {{ ptitle | truncate( 25 ) }} {% endblock %} {% block extrahead %} {% endblock %} {% block body %}

{{ ptitle }}

{% if data['prev'] or data['next'] %}
{% for link in data['links'] %} {% if link['rel'] == 'prev' %} {% trans %}Prev{% endtrans %} {% elif link['rel'] == 'next' %} {% trans %}Next{% endtrans %} {% endif %} {% endfor %}
{% endif %}
{% if data.uri_field %} {% endif %} {% for k, v in data['properties'].items() %} {% if k != data['id_field'] %} {% endif %} {% endfor %}
{% trans %}Property{% endtrans %} {% trans %}Value{% endtrans %}
{{ data.uri_field }} {{ data['properties'].pop(data.uri_field) }}
id {{ data.id }}
{{ k | striptags }} {{ render_item_value(v, 80) }}
{% trans %}Links{% endtrans %}
{% endblock %} {% block extrafoot %} {% endblock %}