{% 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', '.jpeg', '.png', '.gif', '.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 / Item {{ 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 %} Property Value id {{ data.id }} {% for k, v in data['properties'].items() %} {{ k }} {% if k == 'links' %} {% for l in v %} {{ l['title'] }} {% endfor %} {% else %} {{ render_item_value(v, 80) }} {% endif %} {% endfor %} {% endblock %} {% block extrafoot %} {% endblock %}