Themes: add possibility to add an icon to 'render' (just like with mappings), add contact:mastodon support as general question, add mastodon question to hackerspaces

This commit is contained in:
Pieter Vander Vennet 2023-08-10 14:10:06 +02:00
parent 64648f7bb4
commit 03aafbe99c
8 changed files with 237 additions and 99 deletions

View file

@ -112,6 +112,7 @@
"website",
"email",
"phone",
"mastodon",
{
"builtin": "opening_hours_24_7",
"override": {

View file

@ -173,11 +173,13 @@
"render": {
"*": "<a href='tel:{phone}'>{phone}</a>"
},
"icon": "./assets/layers/questions/phone.svg",
"mappings": [
{
"if": "contact:phone~*",
"then": "<a href='tel:{contact:phone}'>{contact:phone}</a>",
"hideInAnswer": true
"hideInAnswer": true,
"icon": "./assets/layers/questions/phone.svg"
}
],
"freeform": {
@ -188,6 +190,21 @@
]
}
},
{
"id": "mastodon",
"description": "Shows and asks for the mastodon handle",
"question": {
"en": "What is the Mastodon-handle of {title()}?"
},
"freeform": {
"key": "contact:mastodon",
"type": "fediverse"
},
"render": {
"*": "{fediverse_link(contact:mastodon)}"
},
"icon": "./assets/svg/mastodon.svg"
},
{
"id": "osmlink",
"render": {
@ -205,6 +222,7 @@
"render": {
"*": "<a href='mailto:{email}' target='_blank'>{email}</a>"
},
"icon": "./assets/svg/envelope.svg",
"labels": [
"contact"
],
@ -236,6 +254,7 @@
"mappings": [
{
"if": "contact:email~*",
"icon": "./assets/svg/envelope.svg",
"then": "<a href='mailto:{contact:email}' target='_blank'>{contact:email}</a>",
"hideInAnswer": true
}
@ -253,6 +272,7 @@
"labels": [
"contact"
],
"icon": "./assets/layers/icons/website.svg",
"question": {
"en": "What is the website of {title()}?",
"nl": "Wat is de website van {title()}?",
@ -292,7 +312,8 @@
{
"if": "contact:website~*",
"then": "<a href='{contact:website}' rel='nofollow noopener noreferrer' target='_blank'>{contact:website}</a>",
"hideInAnswer": true
"hideInAnswer": true,
"icon": "./assets/layers/icons/website.svg"
}
]
},
@ -2203,4 +2224,4 @@
]
}
]
}
}