diff --git a/templates/catalog.html b/templates/catalog.html index 5b55e59..47c64e9 100644 --- a/templates/catalog.html +++ b/templates/catalog.html @@ -1,45 +1,49 @@ {% extends "base.html" %} +{% macro item_detail(entity) %} + {% for key, prop_label in labels.items() %} + {% set claims = entity.claims[key] %} + {% if claims %} +
+ {{ prop_label }}: + {% for claim in claims %} + {% if 'datavalue' in claim.mainsnak %} + {% set claim_qid = claim.mainsnak.datavalue.value.id %} + {{ other[claim_qid] or '[ label missing ]' }} ({{ claim_qid }}) + {% else %} + no value + {% endif %} + {% endfor %} +
+ {% endif %} + {% endfor %} +{% endmacro %} + {% block title %}{{ title }}{% endblock %} {% block content %} -
-

{{ self.title() }}

- {% for item in items %} -
-
-
- -
-
-
-
{{ item.label }}
+
+

{{ self.title() }}

+ {% for item in items %} +
+
+
+ +
+
+
+
{{ item.label }}
-

- view on Wikidata -

+

+ view on Wikidata +

- {% for key, prop_label in labels.items() %} - {% set claims = item.entity['claims'][key] %} - {% if claims %} -
- {{ prop_label }}: - {% for claim in claims %} - {% if 'datavalue' in claim.mainsnak %} - {% set claim_qid = claim.mainsnak.datavalue.value.id %} - {{ other[claim_qid] or '[ label missing ]' }} ({{ claim_qid }}) - {% else %} - no value - {% endif %} - {% endfor %} -
- {% endif %} - {% endfor %} + {{ item_detail(item.entity) }} +
+ {% endfor %}
- {% endfor %} -
{% endblock %}