From 4347becbee97c579da911caa0e2a9cc8db3b9856 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= <skunk@xover.mud.at>
Date: Sun, 6 Sep 2020 19:17:34 +0200
Subject: [PATCH] Heritage: start developing category

---
 heritage.json | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/heritage.json b/heritage.json
index b8ee500..00a17ad 100644
--- a/heritage.json
+++ b/heritage.json
@@ -1,9 +1,29 @@
 {
     "type": "overpass",
     "query": {
-        "8": "nwr[heritage=1];",
-        "11": "nwr[heritage~'^(1|2)$'];"
+        "8": "nwr[heritage~\"^(|.*;)1(|;.*)$\"];",
+        "11": "nwr[heritage~\"^(|.*;)(1|2)(|;.*)$\"];",
+        "13": "nwr[heritage];"
     },
     "feature": {
+        "description": [
+            "{% for op in attribute(tags, 'heritage:operator')|split(';') %}",
+            "{% if const[op].url and attribute(tags, const[op].key) %}<a target=\"_blank\" href=\"{{ const[op].url|replace({\"$1\": attribute(tags, const[op].key)}) }}\">{% endif -%}",
+            "{{- tagTrans('heritage:operator', op) -}}",
+            "{%- if attribute(tags, const[op].key) %}: {{ attribute(tags, const[op].key) }}{% endif %}",
+            "{% if const[op].url and attribute(tags, const[op].key) %}</a>{% endif -%}",
+            "<br/>",
+            "{% endfor %}"
+        ],
+        "priority": "{{ min(tags.heritage|split(\";\")) }}"
+    },
+    "const": {
+        "whc": {
+            "key": "ref:whc"
+        },
+        "bda": {
+            "key": "ref:at:bda",
+            "url": "https://tools.wmflabs.org/denkmalliste/index.php?action=EinzelID&ID=$1"
+        }
     }
 }