From 059abb67d7bcc89cc3fdfd48295c46812d4aef0c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?=
 <plepe@noreply.openstreetbrowser.org>
Date: Mon, 3 Dec 2018 22:11:57 +0100
Subject: [PATCH] xmas: show outdated features in red

---
 xmas.json | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/xmas.json b/xmas.json
index 89049a8..5f698b9 100644
--- a/xmas.json
+++ b/xmas.json
@@ -14,9 +14,17 @@
         ]
     },
     "feature": {
+        "pre": [
+            "{% set isCurrent = meta.timestamp > now|date_modify('-1 month')|date('Y') %}",
+            "{% set bgColor = isCurrent ? '#f2756a' : 'red' %}"
+        ],
         "title": "{{ attribute(tags, \"xmas:name\")|default(trans(\"unnamed\")) }}",
         "description": "{{ tagTransList(\"xmas:feature\", attribute(tags, \"xmas:feature\")) }}",
         "body": [
+            "{% if not isCurrent %}",
+            "<div style='border: 1px solid red; padding: 2px; margin-bottom: 2px;'>Feature has not been updated for the current season! Please check and set the tag 'xmas:lastcheck' to the current date.</div>",
+            "{% endif %}",
+            "",
             "{% if attribute(tags, 'xmas:location') %}",
             "<li class='hasSymbol'>",
             "  <i class=\"fa fa-globe\" aria-hidden=\"true\"></i>",
@@ -60,7 +68,9 @@
         "markerSign": [
             "{{ attribute(const, attribute(tags, 'xmas:feature'))|raw }}",
             ""
-        ]
+        ],
+        "markerSymbol": "{{ markerPointer({\"fillColor\":bgColor})|raw }}",
+        "listMarkerSymbol": "{{ markerCircle({\"fillColor\":bgColor})|raw }}"
     },
     "const": {
         "market": "<img src='maki:commercial'>",