{% extends "base.html" %} {# Optionally renders an img element, otherwise standard value or link rendering #} {% macro render_item_value(v, width) -%} {% set val = v | string | trim | lower %} {% if val|length and (val.endswith(".jpg") or val.endswith(".jpeg") or val.endswith(".png") or val.endswith(".gif") or val.endswith(".bmp")) %} {# Ends with image extension: render img element with link to image #} {% else %} {# All other cases: text or link value #} {{ v | urlize() }} {% endif %} {%- endmacro %} {% block title %}{{ super() }} {{ data['title'] }} - {{ data['id'] }}{% endblock %} {% block crumbs %}{{ super() }} / Collections {% for link in data['links'] %} {% if link.rel == 'collection' %} / {{ link['title'] }} {% endif %} {% endfor %} / Items / {{ data['title'] or data['id'] }} {% endblock %} {% block extrahead %} {% endblock %} {% block body %}

Item {{ data['id'] }}

{% if data['prev'] or data['next'] %}
{% for link in data['links'] %} {% if link['rel'] == 'prev' %} Previous {% elif link['rel'] == 'next' %} Next {% endif %} {% endfor %}
{% endif %}
{% for k, v in data['properties'].items() %} {% if k == 'links' %} {% else %} {% endif %} {% endfor %}
Property Value
id {{ data.id }}
{{ k }} {{ render_item_value(v, 80) }}
{% endblock %} {% block extrafoot %} {% endblock %}