feat(calendar): compact variant for next-events teaser
Calendar block now supports variant: "default" | "compact". - default = full calendar (unchanged) - compact = next N events (default 3) + link to a target page New CalendarCompactBlock.svelte: small card with month/day badge, title, date/time/location line, "Alle kommenden Termine →" footer link resolved from the schema's linkTo reference. Filters to future events (12h tolerance for running ones). BlockRenderer dispatches by block.variant inside the calendar case. Schema (cms_content/_types/core/calendar.json5) adds variant + linkTo + limit fields. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
import PostOverviewBlock from "./blocks/PostOverviewBlock.svelte";
|
||||
import SearchableTextBlock from "./blocks/SearchableTextBlock.svelte";
|
||||
import CalendarBlock from "./blocks/CalendarBlock.svelte";
|
||||
import CalendarCompactBlock from "./blocks/CalendarCompactBlock.svelte";
|
||||
import OrganisationsBlock from "./blocks/OrganisationsBlock.svelte";
|
||||
import OpnFormBlock from "./blocks/OpnFormBlock.svelte";
|
||||
import InternalComponentBlock from "./blocks/InternalComponentBlock.svelte";
|
||||
@@ -82,7 +83,11 @@
|
||||
{:else if type === "searchable_text"}
|
||||
<SearchableTextBlock block={block as SearchableTextBlockData} translations={translations} />
|
||||
{:else if type === "calendar"}
|
||||
<CalendarBlock block={block as CalendarBlockData} translations={translations} />
|
||||
{#if (block as CalendarBlockData).variant === "compact"}
|
||||
<CalendarCompactBlock block={block as CalendarBlockData} translations={translations} />
|
||||
{:else}
|
||||
<CalendarBlock block={block as CalendarBlockData} translations={translations} />
|
||||
{/if}
|
||||
{:else if type === "organisations"}
|
||||
<OrganisationsBlock block={block as OrganisationsBlockData} />
|
||||
{:else if type === "opnform"}
|
||||
|
||||
Reference in New Issue
Block a user