From 5e6183ec77c2fa8f40236e2433c92bfc22b6c932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= <skunk@xover.mud.at> Date: Thu, 29 May 2025 19:35:08 +0200 Subject: [PATCH] Add category for groceries --- groceries.yaml | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ index.json | 3 +++ lang/de.json | 1 + lang/en.json | 1 + 4 files changed, 69 insertions(+) create mode 100644 groceries.yaml diff --git a/groceries.yaml b/groceries.yaml new file mode 100644 index 0000000..5c9015a --- /dev/null +++ b/groceries.yaml @@ -0,0 +1,64 @@ +type: overpass +query: + 15: |- + ( + nwr[shop^supermarket]; + nwr[shop^convenience]; + nwr[shop^dairy]; + nwr[shop^farm]; + nwr[shop^greengrocer]; + nwr[shop^health_food]; + ) +feature: + pre: |- + {% set shop0 = tags.shop|split(';')[0] %} + {% set current = const.default %} + {% if const.shops[shop0] %} + {% set current = const.shops[shop0] %} + {% endif %} + description: |- + {% if tags.shop == 'yes' %} + {{ keyTrans('shop') }} + {% else %} + {{ tagTransList('shop', tags.shop) }} + {% endif %} + markerSign: |- + {% set c = current.sign %} + {% if c|slice(0, 4) == 'fas:' %} + <i class="fas fa-{{ c|slice(4) }}"></i> + {% elseif c|slice(0, 4) == 'far:' %} + <i class="far fa-{{ c|slice(4) }}"></i> + {% elseif c|slice(0, 5) == 'maki:' %} + <img data-src="{{ c }}"> + {% else %} + {{ c|raw }} + {% endif %} +const: + default: + sign: fas:shopping-bag + shops: + dairy: + sign: fas:chesse + farm: + sign: fas:wheat-awn + greengrocer: + sign: fas:carrot + convenience: + sign: fas:shopping-basket + supermarket: + sign: fas:shopping-cart + health_food: + sign: fas:apple-whole +filter: + shop: + name: |- + {{ trans("filter:type") }} + type: select + show_default: true + values: |- + {% set list = [] %} + {% for k, v in const.shops %} + <option value="{{ k }}">{% set list = list|merge([ k ]) %}{{ tagTrans("shop", k) }}</option> + {% endfor %} + sort: natsort + op: has diff --git a/index.json b/index.json index eebf557..a3b9151 100644 --- a/index.json +++ b/index.json @@ -56,6 +56,9 @@ { "id": "shop" }, + { + "id": "groceries" + }, { "id": "craft" }, diff --git a/lang/de.json b/lang/de.json index c23bd34..6f40abe 100644 --- a/lang/de.json +++ b/lang/de.json @@ -104,6 +104,7 @@ "category:proposals": "Vorschläge", "category:transport_alternative": "", "category:walk_amenities_qa": "Einrichtungen Fußgänger", + "category:groceries": "Lebensmittelgeschäfte", "Objects with diet information": "Objekte mit Ernährungsinformationen", "date format not understood": "Datumsformat nicht erkannt", "outdated feature": "Informationen nicht aktuell", diff --git a/lang/en.json b/lang/en.json index 5785941..f22508b 100644 --- a/lang/en.json +++ b/lang/en.json @@ -107,6 +107,7 @@ "category:heritage": "Heritage Protection", "category:hiking_routes": "Hiking routes", "category:etymology": "Etymology", + "category:groceries": "Groceries", "Objects with diet information": "Objects with diet information", "date format not understood": "Invalid Date Format", "outdated feature": "Features outdated",