diff --git a/src/lib/components/blocks/DeadlineBannerBlock.svelte b/src/lib/components/blocks/DeadlineBannerBlock.svelte index 23b76a5..e6b9913 100644 --- a/src/lib/components/blocks/DeadlineBannerBlock.svelte +++ b/src/lib/components/blocks/DeadlineBannerBlock.svelte @@ -1,30 +1,27 @@ -{#if hasContent && !dismissed} +{#if hasContent}
-
-
-

- {sentence}{#if countdownStr}{sentence ? " · " : ""}{countdownStr}{/if}{#if href} - {" "} - {ctaLabel}  - {/if} -

-
- -
-
+
+ {#if sentence} + {sentence} + {/if} + {#if countdownStr} + {countdownStr} + {/if} + {#if href} + {ctaLabel} → + {/if}
{/if} diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 477041c..90d673b 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -26,6 +26,19 @@ */ const isEmbed = $derived(($page.route.id ?? '').startsWith('/(embed)')); + // Nur EIN Balken über der Navi: aktive Frist hat Vorrang, sonst NEU-Banner. + const deadlineActive = $derived.by(() => { + const b = data.deadlineBanner as { mode?: string; date?: string; items?: unknown[] } | null; + if (!b) return false; + if (b.mode === 'auto') return (b.items ?? []).length > 0; + if (!b.date) return false; + const d = new Date(b.date); + if (Number.isNaN(d.getTime())) return false; + const today = new Date(); today.setHours(0, 0, 0, 0); + const t = new Date(d); t.setHours(0, 0, 0, 0); + return t.getTime() >= today.getTime(); + }); + // Live-preview reload bridge: when the page was loaded with // `?preview_draft=...`, accept `rustycms:reload` postMessage events from the // admin iframe parent and re-run the SvelteKit `load()` so the iframe @@ -329,10 +342,9 @@ class="sr-only focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-[100] focus:bg-white focus:px-3 focus:py-2 focus:shadow focus:outline focus:outline-2 focus:outline-wald-600 focus:rounded-xs" >Zum Inhalt springen
- {#if data.deadlineBanner} + {#if deadlineActive && data.deadlineBanner} - {/if} - {#if data.announcementBanner} + {:else if data.announcementBanner} {/if} {#if pageData?.preview || pageData?.previewDraft}