From 51f5c2681e0e705d31b76fc24162834449d2f38a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Mon, 25 Feb 2019 22:14:59 +0100 Subject: [PATCH 1/3] memorial: rewrite (unfin) --- img/blue_plaque.svg | 104 ++++++++++++++++++++++++++++++++++++++++++++ img/plaque.svg | 104 ++++++++++++++++++++++++++++++++++++++++++++ memorial.json | 77 ++++++++++++++++++++------------ 3 files changed, 257 insertions(+), 28 deletions(-) create mode 100644 img/blue_plaque.svg create mode 100644 img/plaque.svg diff --git a/img/blue_plaque.svg b/img/blue_plaque.svg new file mode 100644 index 0000000..ffc85b7 --- /dev/null +++ b/img/blue_plaque.svg @@ -0,0 +1,104 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + Ab Cde + Lorem ipsum + + diff --git a/img/plaque.svg b/img/plaque.svg new file mode 100644 index 0000000..5aa441c --- /dev/null +++ b/img/plaque.svg @@ -0,0 +1,104 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + Ab Cde + Lorem ipsum + + diff --git a/memorial.json b/memorial.json index bd5b942..5197f05 100644 --- a/memorial.json +++ b/memorial.json @@ -25,14 +25,33 @@ }, "feature": { "pre": [ - "{% set value = tags.historic %}", - "{% if tags.historic == 'memorial' and tags.memorial %}", - " {% set value = tags.historic ~ ' memorial=' ~ tags.memorial %}", - "{% elseif tags.historic == 'memorial' and attribute(tags, 'memorial:type') %}", - " {% set value = tags.historic ~ ' memorial=' ~ attribute(tags, 'memorial:type') %}", + "{% set memtype = 'yes' %}", + "{% if tags.historic == 'monument' and tags.monument == 'war_monument' %}", + " {% set memtype = 'war_memorial' %}", + "{% elseif tags.memorial %}", + " {% set memtype = tags.memorial %}", + "{% elseif attribute(tags, 'memorial:type') %}", + " {% set memtype = attribute(tags, 'memorial:type') %}", + "{% elseif attribute(tags, 'monument') %}", + " {% set memtype = attribute(tags, 'monument') %}", "{% endif %}" ], - "description": "{{ tagTransList('historic', value) }}", + "description": [ + "{% if tags.historic == 'monument' and tags.monument == 'war_monument' %}", + " {{ tagTrans('historic', 'monument monument=war_monument') }}", + "{% elseif memtype == 'yes' %}", + " {{ tagTrans('historic', tags.historic) }}", + "{% else %}", + " {{ tagTrans('historic', 'memorial memorial=' ~ memtype) }}", + "{% endif %}", + "", + "{% if tags.historic == 'monument' %}", + " ({{ tagTrans('historic', 'monument') }})", + "{% endif %}" + ], + "priority": [ + "{% if tags.historic == 'monument' %}0[% else %}1{% endif %}" + ], "body": [ "" ], - "markerSign": "{{ const[value].sign|raw }}" + "markerSign": "{% if memtype == 'yes' %}{% else %}{{ const[memtype].sign|raw }}{% endif %}" }, "info": [ "", @@ -87,44 +106,46 @@ "{% endfor %}", "{% if 14 <= map.zoom %}", " ", - " ", + " ", " ", " ", "{% endif %}", "
{{ markerCircle({})|raw }}
{{ markerCircle({})|raw }}
{{ trans('other') }}
" ], - "const": { + "const1": { + "yes": { + "sign": "", + "zoom": 11 + }, "memorial": { - "sign": "", + "sign": "", + "zoom": 14 + } + }, + "const": { + "plaque": { + "sign": "", "zoom": 14 }, - "memorial memorial=plaque": { + "blue_plaque": { + "sign": "", + "zoom": 14 + }, + "statue": { "sign": "", "zoom": 14 }, - "monument": { - "sign": "", - "zoom": 11 + "war_memorial": { + "sign": "", + "zoom": 14 } }, "filter": { "type": { "name": "{{ trans('filter:type') }}", + "show_default": "true", "type": "select", - "values": { - "monument": { - "name": "{{ tagTrans('historic', 'monument') }}", - "query": "nwr[historic=monument]" - }, - "memorial": { - "name": "{{ tagTrans('historic', 'memorial') }}", - "query": "nwr[historic=memorial]" - }, - "stolperstein": { - "name": "{{ tagTrans('historic', 'memorial memorial=stolperstein') }}", - "query": "(nwr[memorial=stolperstein];nwr[\"memorial:type\"=stolperstein];)" - } - } + "values": "{% for k, v in const %}{% endfor %}" }, "conflict": { "key": "memorial:conflict", From 13c9999cf79702dfe684672f3056a976708253f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Mon, 4 Mar 2019 21:24:09 +0100 Subject: [PATCH 2/3] memorial: more types, add alias, different translation --- memorial.json | 94 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 68 insertions(+), 26 deletions(-) diff --git a/memorial.json b/memorial.json index 5197f05..c61991c 100644 --- a/memorial.json +++ b/memorial.json @@ -26,27 +26,32 @@ "feature": { "pre": [ "{% set memtype = 'yes' %}", - "{% if tags.historic == 'monument' and tags.monument == 'war_monument' %}", - " {% set memtype = 'war_memorial' %}", - "{% elseif tags.memorial %}", + "{% if tags.memorial %}", " {% set memtype = tags.memorial %}", "{% elseif attribute(tags, 'memorial:type') %}", " {% set memtype = attribute(tags, 'memorial:type') %}", "{% elseif attribute(tags, 'monument') %}", " {% set memtype = attribute(tags, 'monument') %}", - "{% endif %}" + "{% elseif attribute(tags, 'memorial_type') %}", + " {% set memtype = attribute(tags, 'memorial_type') %}", + "{% endif %}", + "", + "{% set memgroup = memtype %}", + "{% for value, data in const %}", + "{% if memtype in data.alias %}", + "{% set memgroup = value %}", + "{% endif %}", + "{% endfor %}" ], "description": [ - "{% if tags.historic == 'monument' and tags.monument == 'war_monument' %}", - " {{ tagTrans('historic', 'monument monument=war_monument') }}", - "{% elseif memtype == 'yes' %}", - " {{ tagTrans('historic', tags.historic) }}", - "{% else %}", - " {{ tagTrans('historic', 'memorial memorial=' ~ memtype) }}", + "{% if memtype != 'yes' and tags.historic == 'monument' %}", + " {{ tagTrans('historic', 'monument') }}", "{% endif %}", "", - "{% if tags.historic == 'monument' %}", - " ({{ tagTrans('historic', 'monument') }})", + "{% if memtype == 'yes' %}", + " {{ tagTrans('historic', tags.historic) }}", + "{% else %}", + " {{ tagTrans('memorial', memtype) }}", "{% endif %}" ], "priority": [ @@ -92,7 +97,7 @@ "{% endif %}", "" ], - "markerSign": "{% if memtype == 'yes' %}{% else %}{{ const[memtype].sign|raw }}{% endif %}" + "markerSign": "{{ const[memgroup].sign|raw }}" }, "info": [ "", @@ -100,7 +105,7 @@ "{% if data.zoom <= map.zoom %}", " ", " ", - " ", + " ", " ", "{% endif %}", "{% endfor %}", @@ -112,18 +117,9 @@ "{% endif %}", "
{{ markerCircle({})|raw }}
{{ data.sign|raw }}
{{ tagTrans('historic', value) }}{{ tagTrans('memorial', value) }}{% for alias in data.alias %}, {{ tagTrans('memorial', alias) }}{% endfor %}
" ], - "const1": { - "yes": { - "sign": "", - "zoom": 11 - }, - "memorial": { - "sign": "", - "zoom": 14 - } - }, "const": { "plaque": { + "alias": [ "plate" ], "sign": "", "zoom": 14 }, @@ -132,12 +128,58 @@ "zoom": 14 }, "statue": { - "sign": "", + "sign": "", "zoom": 14 }, "war_memorial": { + "alias": [ "war_monument" ], "sign": "", "zoom": 14 + }, + "stolperstein": { + "sign": "", + "zoom": 14 + }, + "stone": { + "sign": "", + "zoom": 14 + }, + "bust": { + "alias": [ "person" ], + "sign": "", + "zoom": 14 + }, + "stele": { + "alias": [ "obelisk" ], + "sign": "", + "zoom": 14 + }, + "sculpture": { + "sign": "", + "zoom": 14 + }, + "ghost_bike": { + "sign": "", + "zoom": 14 + }, + "vehicle": { + "alias": [ "tank" ], + "sign": "", + "zoom": 14 + }, + "cross": { + "sign": "", + "zoom": 14 + }, + "flood_mark": { + "alias": [ "high_water_mark" ], + "sign": "", + "zoom": 14 + }, + "grave": { + "alias": [ "graveyard" ], + "sign": "", + "zoom": 14 } }, "filter": { @@ -145,7 +187,7 @@ "name": "{{ trans('filter:type') }}", "show_default": "true", "type": "select", - "values": "{% for k, v in const %}{% endfor %}" + "values": "{% for k, v in const %}{% endfor %}" }, "conflict": { "key": "memorial:conflict", From e1850dafc8fb52fae723c5d02c20e7f4e0b927ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Tue, 5 Mar 2019 14:06:41 +0100 Subject: [PATCH 3/3] memorial: Always show memorial/monument --- memorial.json | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/memorial.json b/memorial.json index c61991c..5c75c4b 100644 --- a/memorial.json +++ b/memorial.json @@ -44,14 +44,10 @@ "{% endfor %}" ], "description": [ - "{% if memtype != 'yes' and tags.historic == 'monument' %}", - " {{ tagTrans('historic', 'monument') }}", - "{% endif %}", + "{{ tagTrans('historic', tags.historic) }}", "", - "{% if memtype == 'yes' %}", - " {{ tagTrans('historic', tags.historic) }}", - "{% else %}", - " {{ tagTrans('memorial', memtype) }}", + "{% if memtype != 'yes' %}", + " ({{ tagTrans('memorial', memtype) }})", "{% endif %}" ], "priority": [ @@ -111,7 +107,7 @@ "{% endfor %}", "{% if 14 <= map.zoom %}", " ", - " {{ markerCircle({})|raw }}
", + " {{ markerCircle({})|raw }}
", " {{ trans('other') }}", " ", "{% endif %}",