From 62e10bc1cd6050b554d8e4863c6089aa0988ef3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Mon, 18 Apr 2022 09:25:45 +0200 Subject: [PATCH] name-etymology: description/details --- name-etymology.json | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/name-etymology.json b/name-etymology.json index 1234e01..c7e8402 100644 --- a/name-etymology.json +++ b/name-etymology.json @@ -14,10 +14,26 @@ }, "feature": { "description": [ - "{{ attribute(tags, \"name:etymology\")|enumerate }}", + "{% set found = false %}", + "{% for k in ['amenity', 'shop', 'telecom', 'waterway', 'craft', 'highway', 'railway', 'aerialway', 'emergency', 'geological', 'man_made', 'natural', 'office', 'power', 'aeroway', 'tourism', 'leisure', 'military', 'landuse', 'barrier', 'route'] if not found %}", + " {% if attribute(tags, k) and attribute(tags, k) != 'yes' %}", + " {{ tagTransList(k, attribute(tags, k)) }}", + " {% set found = true %}", + " {% endif %}", + "{% endfor %}", + "{% if found %}{# nothing #}", + "{% elseif tags.building and tags.building != 'yes' %}", + "{{ tagTransList('building', tags.building) }}", + "{% elseif tags.historic and tags.historic not in ['heritage', 'yes', 'building'] %}", + "{{ tagTransList('historic', tags.historic) }}", + "{% elseif tags.building == 'yes' or tags.historic == 'building' %}", + "{{ keyTrans('building') }}", + "{% endif %}" + ], + "details": [ + "{% if attribute(tags, 'name:etymology') %}{{ attribute(tags, 'name:etymology')|enumerate }}{% endif %}", "{% if attribute(tags, \"name:start_date\") %}(since {{ attribute(tags, \"name:start_date\")|osmFormatDate({ format: \"short\" }) }}){% endif %}" ], - "popupDescription": " ", "body": [ "{{ keyTrans('name:etymology') }}: {{ attribute(tags, \"name:etymology\")|enumerate }}
", "{{ keyTrans('name:start_date') }}: {% if attribute(tags, \"name:start_date\") %}{{ attribute(tags, \"name:start_date\")|osmFormatDate({ format: \"long\" }) }}{% else %}{{ trans('unknown') }}{% endif %}
",