From fc81d973a51a990b9e8b50dfe72885b74264a495 Mon Sep 17 00:00:00 2001 From: Peter Meier Date: Thu, 4 Jun 2026 13:02:47 +0200 Subject: [PATCH] feat: Ansprechpartner im OrganisationsMap Detail-Panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Marker-Klick zeigt jetzt zusätzlich Name, Rolle, Email und Telefon der Kontaktpersonen pro Organisation. Co-Authored-By: Claude Sonnet 4.6 --- src/lib/block-types.ts | 1 + .../blocks/OrganisationsMapBlock.svelte | 37 ++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/lib/block-types.ts b/src/lib/block-types.ts index 7f5802b..00807b1 100644 --- a/src/lib/block-types.ts +++ b/src/lib/block-types.ts @@ -316,6 +316,7 @@ export interface OrganisationEntry { whatsapp?: string; youtube?: string; location?: { text?: string; lat?: number; lng?: number }; + contacts?: (string | ContactEntry)[]; } /** Organisations-Block (_type: "organisations"). */ diff --git a/src/lib/components/blocks/OrganisationsMapBlock.svelte b/src/lib/components/blocks/OrganisationsMapBlock.svelte index 635e8c2..9aa0a47 100644 --- a/src/lib/components/blocks/OrganisationsMapBlock.svelte +++ b/src/lib/components/blocks/OrganisationsMapBlock.svelte @@ -2,7 +2,7 @@ import "leaflet/dist/leaflet.css"; import { onMount, onDestroy } from "svelte"; import { getBlockLayoutClasses } from "$lib/block-layout"; - import type { OrganisationsMapBlockData, OrganisationEntry } from "$lib/block-types"; + import type { OrganisationsMapBlockData, OrganisationEntry, ContactEntry } from "$lib/block-types"; import Icon from "@iconify/svelte"; import "$lib/iconify-offline"; import { marked } from "$lib/markdown-safe"; @@ -33,6 +33,12 @@ : "", ); + const contacts = $derived( + (selectedOrg?.contacts ?? []).filter( + (c): c is ContactEntry => typeof c === "object" && c !== null && !!c.name, + ), + ); + function getLink(org: OrganisationEntry): string | null { if (!org.link || typeof org.link === "string") return null; return org.link.url ?? null; @@ -156,6 +162,35 @@ {/if} + {#if contacts.length > 0} +
+

Ansprechpartner

+ {#each contacts as c} +
+

{c.name}

+ {#if c.role} +

{c.role}

+ {/if} + {#if c.email} + + + {c.email} + + {/if} + {#if c.phone} + + + {c.phone} + + {/if} + {#if c.note} +

{c.note}

+ {/if} +
+ {/each} +
+ {/if} + {#if getLink(selectedOrg)}