diff --git a/assets/layers/hackerspace/hackerspace.json b/assets/layers/hackerspace/hackerspace.json
index 8ebf9bf87..2beb640e2 100644
--- a/assets/layers/hackerspace/hackerspace.json
+++ b/assets/layers/hackerspace/hackerspace.json
@@ -112,6 +112,7 @@
"website",
"email",
"phone",
+ "mastodon",
{
"builtin": "opening_hours_24_7",
"override": {
diff --git a/assets/layers/questions/questions.json b/assets/layers/questions/questions.json
index 678b0b402..c3412b52d 100644
--- a/assets/layers/questions/questions.json
+++ b/assets/layers/questions/questions.json
@@ -173,11 +173,13 @@
"render": {
"*": "{phone}"
},
+ "icon": "./assets/layers/questions/phone.svg",
"mappings": [
{
"if": "contact:phone~*",
"then": "{contact:phone}",
- "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": {
"*": "{email}"
},
+ "icon": "./assets/svg/envelope.svg",
"labels": [
"contact"
],
@@ -236,6 +254,7 @@
"mappings": [
{
"if": "contact:email~*",
+ "icon": "./assets/svg/envelope.svg",
"then": "{contact:email}",
"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": "{contact:website}",
- "hideInAnswer": true
+ "hideInAnswer": true,
+ "icon": "./assets/layers/icons/website.svg"
}
]
},
@@ -2203,4 +2224,4 @@
]
}
]
-}
\ No newline at end of file
+}
diff --git a/langs/en.json b/langs/en.json
index 62a481843..24f6953cf 100644
--- a/langs/en.json
+++ b/langs/en.json
@@ -610,6 +610,11 @@
"feedback": "This is not a valid email address",
"noAt": "An e-mail address must contain an @"
},
+ "fediverse": {
+ "description": "A fediverse handle, often @username@server.tld",
+ "feedback": "A fediverse handle consists of @username@server.tld or is a link to a profile",
+ "invalidHost": "{host} is not a valid hostname"
+ },
"float": {
"description": "a number",
"feedback": "This is not a number"
diff --git a/src/Models/ThemeConfig/Json/TagRenderingConfigJson.ts b/src/Models/ThemeConfig/Json/TagRenderingConfigJson.ts
index 583294f3d..56bfd7876 100644
--- a/src/Models/ThemeConfig/Json/TagRenderingConfigJson.ts
+++ b/src/Models/ThemeConfig/Json/TagRenderingConfigJson.ts
@@ -41,6 +41,26 @@ export interface TagRenderingConfigJson {
| Record
| { special: Record> & { type: string } }
+ /**
+ * An icon shown next to the rendering; typically shown pretty small
+ * This is only shown next to the "render" value
+ * Type: icon
+ */
+ icon?:
+ | string
+ | {
+ /**
+ * The path to the icon
+ * Type: icon
+ */
+ path: string
+ /**
+ * A hint to mapcomplete on how to render this icon within the mapping.
+ * This is translated to 'mapping-icon-', so defining your own in combination with a custom CSS is possible (but discouraged)
+ */
+ class?: "small" | "medium" | "large" | string
+ }
+
/**
* Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.
*
diff --git a/src/Models/ThemeConfig/TagRenderingConfig.ts b/src/Models/ThemeConfig/TagRenderingConfig.ts
index 6cd5dc4dc..940056a99 100644
--- a/src/Models/ThemeConfig/TagRenderingConfig.ts
+++ b/src/Models/ThemeConfig/TagRenderingConfig.ts
@@ -1,23 +1,24 @@
-import { Translation, TypedTranslation } from "../../UI/i18n/Translation"
-import { TagsFilter } from "../../Logic/Tags/TagsFilter"
+import {Translation, TypedTranslation} from "../../UI/i18n/Translation"
+import {TagsFilter} from "../../Logic/Tags/TagsFilter"
import Translations from "../../UI/i18n/Translations"
-import { TagUtils, UploadableTag } from "../../Logic/Tags/TagUtils"
-import { And } from "../../Logic/Tags/And"
-import { Utils } from "../../Utils"
-import { Tag } from "../../Logic/Tags/Tag"
+import {TagUtils, UploadableTag} from "../../Logic/Tags/TagUtils"
+import {And} from "../../Logic/Tags/And"
+import {Utils} from "../../Utils"
+import {Tag} from "../../Logic/Tags/Tag"
import BaseUIElement from "../../UI/BaseUIElement"
import Combine from "../../UI/Base/Combine"
import Title from "../../UI/Base/Title"
import Link from "../../UI/Base/Link"
import List from "../../UI/Base/List"
-import {
- MappingConfigJson,
- QuestionableTagRenderingConfigJson,
-} from "./Json/QuestionableTagRenderingConfigJson"
-import { FixedUiElement } from "../../UI/Base/FixedUiElement"
-import { Paragraph } from "../../UI/Base/Paragraph"
+import {MappingConfigJson, QuestionableTagRenderingConfigJson,} from "./Json/QuestionableTagRenderingConfigJson"
+import {FixedUiElement} from "../../UI/Base/FixedUiElement"
+import {Paragraph} from "../../UI/Base/Paragraph"
import Svg from "../../Svg"
-import Validators, { ValidatorType } from "../../UI/InputElement/Validators"
+import Validators, {ValidatorType} from "../../UI/InputElement/Validators"
+
+export interface Icon {
+
+}
export interface Mapping {
readonly if: UploadableTag
@@ -45,6 +46,8 @@ export interface Mapping {
export default class TagRenderingConfig {
public readonly id: string
public readonly render?: TypedTranslation