Theme: tool_library: improve membership handling

This commit is contained in:
Pieter Vander Vennet 2024-07-28 04:00:13 +02:00
parent 6cd7828ed3
commit 62bc005534

View file

@ -52,6 +52,12 @@
"then": { "then": {
"en": "A <b>membership is required</b> to use this tool library" "en": "A <b>membership is required</b> to use this tool library"
} }
},
{
"if": "membership=optional",
"then": {
"en": "A <b>membership is possible</b> but not required to use this tool library"
}
} }
] ]
}, },
@ -72,18 +78,30 @@
"en": "A membership costs {charge:membership}" "en": "A membership costs {charge:membership}"
} }
}, },
{ {
"question": { "question": {
"en": "Is a fee asked to borrow tools?" "en": "Is a fee asked to borrow tools?"
}, },
"id": "fee", "id": "fee",
"mappings": [ "mappings": [
{
"if": {
"and": [
"fee=no",
"membership=required"
]
},
"then": {
"en": "Borrowing tools is free if one has a membership"
},
"hideInAnswer": "membership!=required"
},
{ {
"if": "fee=no", "if": "fee=no",
"then": { "then": {
"en": "Borrowing tools is free" "en": "Borrowing tools is free"
} },
"hideInAnswer": "membership=required"
}, },
{ {
"if": "fee=yes", "if": "fee=yes",
@ -144,7 +162,11 @@
"charge:membership": { "charge:membership": {
"inverted": true, "inverted": true,
"quantity": "duration", "quantity": "duration",
"denominations": ["years","months","weeks"] "denominations": [
"years",
"months",
"weeks"
]
} }
} }
] ]