From 765ee2b040a087ac7fa0f09fda58b5493da30667 Mon Sep 17 00:00:00 2001 From: Osmwithspace <> Date: Mon, 17 Mar 2025 12:43:54 +0100 Subject: [PATCH] add advanced charge questions --- assets/layers/campsite/campsite.json | 140 +++++++++++++++++---------- 1 file changed, 88 insertions(+), 52 deletions(-) diff --git a/assets/layers/campsite/campsite.json b/assets/layers/campsite/campsite.json index 0df9f02626..4ade74743a 100644 --- a/assets/layers/campsite/campsite.json +++ b/assets/layers/campsite/campsite.json @@ -134,58 +134,6 @@ "id": "name" }, "contact", - { - "id": "fee", - "question": { - "en": "Is a fee charged here?", - "de": "Wird hier eine Gebühr erhoben?", - "ca": "Aquí es cobra alguna tarifa?", - "cs": "Platí se tu poplatek?" - }, - "render": { - "en": "A fee of {charge} should be paid for here", - "de": "Hier wird eine Gebühr von {charge} erhoben", - "ca": "S'ha de pagar una tarifa de {charge} aquí", - "cs": "Platí se tu poplatek {charge}" - }, - "freeform": { - "key": "charge", - "type": "currency", - "addExtraTags": [ - "fee=yes" - ], - "inline": true - }, - "mappings": [ - { - "if": "fee=no", - "addExtraTags": [ - "charge=" - ], - "then": { - "en": "The campsite is free of charge", - "de": "Der Zeltplatz ist kostenlos", - "ca": "El càmping és gratuït", - "cs": "Kempování je zdarma" - } - }, - { - "if": { - "and": [ - "fee=yes", - "charge=" - ] - }, - "then": { - "en": "A fee is charged here.", - "de": "Hier wird eine Gebühr erhoben.", - "ca": "Aquí es cobra una tarifa.", - "cs": "Platí se tu poplatek." - }, - "hideInAnswer": "charge~*" - } - ] - }, { "question": { "de": "Wie viele Personen können hier übernachten?", @@ -205,6 +153,94 @@ }, "id": "capacity_persons" }, + { + "icon": "./assets/layers/questions/cash.svg", + "condition": { + "and": [ + "charge=" + ] + }, + "id": "fee", + "question": { + "en": "Is there a fee?", + "de": "Gibt es hier eine Gebühr?" + }, + "mappings": [ + { + "if": "fee=no", + "addExtraTags": [ + "charge=" + ], + "then": { + "en": "The campsite is free of charge", + "de": "Der Zeltplatz ist kostenlos" + }, + "icon": "./assets/layers/questions/cash.svg" + }, + { + "if": "fee=yes", + "then": { + "en": "There is a fee.", + "de": "Es gibt eine Gebühr." + }, + "icon": "./assets/layers/questions/cash.svg" + } + ] + }, + { + "icon": "./assets/layers/questions/cash.svg", + "condition": { + "and": [ + "charge!~^(.*;|)[^;\/]*\/day(|[^\/].*)$", + "fee!=no" + ] + }, + "id": "charge_person_day", + "question": { + "en": "What is the charge per person per day?", + "de": "Was ist die Gebühr pro Person pro Tag?" + }, + "render": { + "en": "Charge per person per day: {charge}", + "de": "Gebühr pro Person pro Tag: {charge}" + }, + "freeform": { + "key": "charge", + "type": "currency", + "inline": true, + "postfixDistinguished": "person/day", + "addExtraTags": [ + "fee=yes" + ] + } + }, + { + "icon": "./assets/layers/questions/cash.svg", + "condition": { + "and": [ + "charge!~.*\/person\/day.*", + "fee!=no" + ] + }, + "id": "charge_day", + "question": { + "en": "What is the charge per day?", + "de": "Was ist die Gebühr pro Tag?" + }, + "render": { + "en": "Charge per day: {charge}", + "de": "Gebühr pro Tag: {charge}" + }, + "freeform": { + "key": "charge", + "type": "currency", + "inline": true, + "postfixDistinguished": "day", + "addExtraTags": [ + "fee=yes" + ] + } + }, "caravansites.caravansites-toilets", "toilet_at_amenity.toilets-wheelchair", "questions",