diff --git a/templates/depicteds.html b/templates/depicted.html similarity index 62% copy from templates/depicteds.html copy to templates/depicted.html index a6180b0..18ccbdb 100644 --- a/templates/depicteds.html +++ b/templates/depicted.html @@ -1,10 +1,9 @@ -{% for depicted in depicteds %} -{% if depicted.iiif_region %} +{% macro depicted_div(depicted) %}
{{ depicted | depicted_item_link }}
-{% endif %} -{% endfor %} +{% endmacro %} diff --git a/templates/depicteds.html b/templates/depicteds.html index a6180b0..feba1c2 100644 --- a/templates/depicteds.html +++ b/templates/depicteds.html @@ -1,10 +1,6 @@ +{% from "depicted.html" import depicted_div %} {% for depicted in depicteds %} {% if depicted.iiif_region %} -
- {{ depicted | depicted_item_link }} -
+{{ depicted_div(depicted) }} {% endif %} {% endfor %} diff --git a/templates/image.html b/templates/image.html index d2c59a7..09dada0 100644 --- a/templates/image.html +++ b/templates/image.html @@ -1,46 +1,41 @@ +{% from "depicted.html" import depicted_div %} {% macro image(image_title, image_attribution, image_url, depicteds, heading="h2") %} {% set image_title_ = image_title.replace(' ', '_') %} <{{ heading }}>{{ image_title }} {% if image_attribution %}

{{ image_attribution.attribution_html }}

{% endif %}
{% set depicteds_without_region = [] %} {% for depicted in depicteds %} {% if depicted.iiif_region %} -
- {{ depicted | depicted_item_link }} -
+ {{ depicted_div(depicted) }} {% else %} {% do depicteds_without_region.append(depicted) %} {% endif %} {% endfor %}
{% if depicteds_without_region %}
Depicted, but with no region specified:
{% endif %} {% endmacro %}