From 60242a0dbdb36039fb091406f6a711805cfb684c Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 7 May 2024 17:25:35 +0200 Subject: [PATCH] Fix various warnings in themes --- assets/layers/bike_parking/bike_parking.json | 11 +-- .../climbing_opportunity.json | 2 +- .../outdoor_seating/outdoor_seating.json | 2 +- assets/layers/postoffices/postoffices.json | 1 - assets/themes/velopark/velopark.json | 79 ++++++++++++++----- 5 files changed, 63 insertions(+), 32 deletions(-) diff --git a/assets/layers/bike_parking/bike_parking.json b/assets/layers/bike_parking/bike_parking.json index 403fe0c6b..3b9ac77f4 100644 --- a/assets/layers/bike_parking/bike_parking.json +++ b/assets/layers/bike_parking/bike_parking.json @@ -712,16 +712,7 @@ "type": "currency" } }, - { - "builtin": "opening_hours_24_7", - "override": { - "mappings": [ - { - "alsoShowIf": "opening_hours=" - } - ] - } - }, + "opening_hours_24_7_default", { "id": "operator", "question": { diff --git a/assets/layers/climbing_opportunity/climbing_opportunity.json b/assets/layers/climbing_opportunity/climbing_opportunity.json index 447fda778..a524cadb6 100644 --- a/assets/layers/climbing_opportunity/climbing_opportunity.json +++ b/assets/layers/climbing_opportunity/climbing_opportunity.json @@ -34,7 +34,7 @@ ] } }, - "minzoom": 19, + "minzoom": 18, "title": { "render": { "en": "Climbing opportunity?", diff --git a/assets/layers/outdoor_seating/outdoor_seating.json b/assets/layers/outdoor_seating/outdoor_seating.json index c586b11b4..850c9dc99 100644 --- a/assets/layers/outdoor_seating/outdoor_seating.json +++ b/assets/layers/outdoor_seating/outdoor_seating.json @@ -9,7 +9,7 @@ "source": { "osmTags": "leisure=outdoor_seating" }, - "minzoom": 19, + "minzoom": 18, "title": { "render": { "en": "Outdoor Seating area" diff --git a/assets/layers/postoffices/postoffices.json b/assets/layers/postoffices/postoffices.json index 81d586f95..1350be010 100644 --- a/assets/layers/postoffices/postoffices.json +++ b/assets/layers/postoffices/postoffices.json @@ -169,7 +169,6 @@ "ca": "Aquesta botiga és un col·laborador postal?", "cs": "Jedná se o partnerskou poštu?" }, - "condition": "post_office=post_partner", "mappings": [ { "if": "post_office=post_partner", diff --git a/assets/themes/velopark/velopark.json b/assets/themes/velopark/velopark.json index 4bfcc87cd..63e59c515 100644 --- a/assets/themes/velopark/velopark.json +++ b/assets/themes/velopark/velopark.json @@ -47,6 +47,14 @@ } ], "tagRenderings": [ + { + "id": "login", + "render": { + "special": { + "type": "login_button" + } + } + }, { "id": "velopark-link", "render": { @@ -64,14 +72,6 @@ } } }, - { - "id": "login", - "render": { - "special": { - "type": "login_button" - } - } - }, { "id": "show-data-velopark", "render": { @@ -87,16 +87,32 @@ { "id": "closest_parkings", "render": { - "en": "

Nearby parkings

There are {_nearby_bicycle_parkings:count} bicycle parkings within 25m known in OpenStreetMap.", - "nl": "

Parkings in de buurt

Er zijn {_nearby_bicycle_parkings:count} fietsparkings gekend binnen 25m in OpenStreetMap." - } + "en": "

Nearby parkings

There are {_nearby_bicycle_parkings:count} bicycle parkings within {_distance_cutoff}m known in OpenStreetMap.", + "nl": "

Parkings in de buurt

Er zijn {_nearby_bicycle_parkings:count} fietsparkings gekend binnen {_distance_cutoff}m in OpenStreetMap." + }, + "condition": "_nearby_bicycle_parkings:count>0", + "mappings": [ + { + "if": "_nearby_bicycle_parkings:count=0", + "then": { + "en": "

No nearby parkings

There are no bicycle parkings in OpenStreetMap known within {_distance_cutoff}m", + "nl": "

Geen fietsenstallingen in de buurt

Er zijn geen fietsenstallingen gekend op OpenStreetMap op minder dan {_distance_cutoff}m" + } + } + ] }, { "id": "list_nearby_bike_parkings", + "condition": { + "and": [ + "mr_taskStatus=Created", + "_nearby_bicycle_parkings:count>0" + ] + }, "render": { "before": { - "en": "Choose below which bicycle parking you want to link. This will not apply the attributes.", - "nl": "Kies hieronder welke fietsenstalling je wilt linken. Dit zal de attributen niet kopieren." + "en": "Choose below which bicycle parking you want to link.", + "nl": "Kies hieronder welke fietsenstalling je wilt linken." }, "special": { "type": "multi", @@ -108,6 +124,7 @@ }, { "id": "title_create_new", + "condition": "mr_taskStatus=Created", "render": { "en": "

Add a parking to OpenStreetMap

Use this if the bicycle parking is missing in OpenStreetMap (there is no blue or green pin)", "nl": "

Parking toevoegen aan OpenStreetMap

Gebruik dit als er nog geen blauwe of groene parkeerplaats-pin staat op de juiste plaats." @@ -115,14 +132,15 @@ }, { "id": "import_point", + "condition": "mr_taskStatus=Created", "render": { "special": { "type": "import_button", "targetLayer": "bike_parking_with_velopark_ref bike_parking", "tags": "amenity=bicycle_parking;ref:velopark=$ref:velopark", "text": { - "en": "Create a new bicycle parking in OSM. This parking will have the link, but not all attributes", - "nl": "Maak een nieuwe parking aan in OSM. Deze parking zal gelinkt zijn met Velopark, maar niet de attributen bevatten" + "en": "Create a new bicycle parking in OSM. This parking will have the link, you'll be able to copy the attributes in the next step", + "nl": "Maak een nieuwe parking aan in OSM. Deze parking zal gelinkt zijn met Velopark en je kan in de volgende stap de attributen overzetten" }, "maproulette_id": "mr_taskId" } @@ -130,6 +148,7 @@ }, { "id": "title_manually_copy", + "condition": "mr_taskStatus=Created", "render": { "en": "

Manually link

Does the bicycle parking exist in OpenStreetMap but is it further then 25m away? Then:
  1. Copy the following URL: {ref:velopark}
  2. Select the correct bicycle parking on the map
  3. Paste the URL into the question What is the URL of the data path in Velopark?
  4. Mark this item as handled with the button below:
  5. ", "nl": "

    Manueel linken

    Bestaat de fietsenstalling in OpenStreetMap maar is staat deze meer dan 25m verder?In dit geval:
    1. Kopieer de volgende URL: {ref:velopark}
    2. Selecteer de juiste fietsenstalling op de kaart
    3. Plak de URL in de vraag Wat is de data-url van deze fietsenstalling in Velopark.be?
    4. Open deze fietsenstalling opnieuw en markeer deze als gelinkt met onderstaande knop:
    5. " @@ -137,6 +156,7 @@ }, { "id": "close_mr", + "condition": "mr_taskStatus=Created", "render": { "special": { "type": "maproulette_set_status", @@ -150,6 +170,7 @@ }, { "id": "title_error", + "condition": "mr_taskStatus=Created", "render": { "en": "

      Closing without importing or linking

      ", "nl": "

      Afsluiten zonder importeren of linken

      " @@ -157,6 +178,7 @@ }, { "id": "close_mr_incorrect", + "condition": "mr_taskStatus=Created", "render": { "special": { "type": "maproulette_set_status", @@ -190,7 +212,12 @@ } } }, - "{nearby_images(open,readonly)}" + { + "id": "nearby_images", + "render": { + "*": "{nearby_images(open,readonly)}" + } + } ], "lineRendering": [], "filter": [ @@ -221,8 +248,9 @@ } ], "calculatedTags": [ + "_distance_cutoff=50", "mr_velopark_id=feat.properties['ref:velopark']?.split('/')?.at(-1)", - "_nearby_bicycle_parkings=closestn(feat)(['bike_parking','bike_parking_with_velopark_ref'], 100, undefined, 25)", + "_nearby_bicycle_parkings=closestn(feat)(['bike_parking','bike_parking_with_velopark_ref'], 100, undefined, get(feat)('_distance_cutoff'))", "_nearby_bicycle_parkings:count=get(feat)('_nearby_bicycle_parkings').length", "_nearby_bicycle_parkings:props=get(feat)('_nearby_bicycle_parkings').map(f => ({_distance: Math.round(f.distance), _ref: feat.properties['ref:velopark'], _mr_id: feat.properties.id, '_velopark:id': (f.feat.properties['_velopark:id'] ?? 'unlinked') /*Explicit copy to trigger lazy loading*/, ...f.feat.properties}))" ], @@ -262,7 +290,9 @@ ], "hideTagRenderingsWithLabels": [ "images", - "leftover-questions" + "leftover-questions", + "qr_code", + "favourite_status" ], "override": { "id": "bike_parking_with_velopark_ref", @@ -346,7 +376,9 @@ ], "hideTagRenderingsWithLabels": [ "images", - "leftover-questions" + "leftover-questions", + "qr_code", + "favourite_status" ], "override": { "doCount": false, @@ -437,6 +469,15 @@ } } } + ], + "tagRenderings+": [ + { + "id": "no_save_needed", + "render": { + "en": "Changes are automatically saved. You can simply close this popup with the cross at the upper-right", + "nl": "Wijzigingen worden automatisch opgeslaan. Je kan deze popup gewoon sluiten met het kruisje rechtsbovenaan" + } + } ] }, "lockLocation": [