{% 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 #} {% 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 %} {% trans %}Property{% endtrans %} {% trans %}Value{% endtrans %} {% if data.uri_field %} {{ data.uri_field }} {{ data['properties'].pop(data.uri_field) }} {% endif %} id {{ data.id }} {% for k, v in data['properties'].items() %} {% if k != data['id_field'] %} {{ k | striptags }} {{ render_item_value(v, 80) }} {% endif %} {% endfor %} {% trans %}Links{% endtrans %} {% for l in data['links'] %} {% if l['href'] %} {{ l['title'] or (l['href'].split('/') | last) | truncate( 25 ) }} {% if l['type'] %} ({{ l['type'] }}) {% endif %} {% endif %} {% endfor %} {% endblock %} {% block extrafoot %} {% endblock %}