feat(geschichten): show blog writers' own drafts on the Geschichten overview (#807) (#813)
Some checks failed
CI / Unit & Component Tests (push) Failing after 3m48s
CI / OCR Service Tests (push) Successful in 22s
CI / Backend Unit Tests (push) Successful in 5m24s
CI / fail2ban Regex (push) Successful in 53s
CI / Semgrep Security Scan (push) Successful in 23s
CI / Compose Bucket Idempotency (push) Successful in 1m9s

This commit was merged in pull request #813.
This commit is contained in:
2026-06-12 19:46:03 +02:00
parent b33d0eb850
commit 38a6d6b0fc
14 changed files with 316 additions and 35 deletions

View File

@@ -7,12 +7,13 @@ import type { components } from '$lib/generated/api';
type GeschichteRow = Pick<
components['schemas']['GeschichteSummary'],
'id' | 'title' | 'body' | 'type' | 'author' | 'publishedAt'
'id' | 'title' | 'body' | 'type' | 'status' | 'author' | 'publishedAt'
>;
let { geschichte }: { geschichte: GeschichteRow } = $props();
const isJourney = $derived(geschichte.type === 'JOURNEY');
const isDraft = $derived(geschichte.status === 'DRAFT');
const publishedAt = $derived(formatPublishedAt(geschichte.publishedAt, 'short'));
@@ -44,12 +45,20 @@ const authorName = $derived(formatAuthorName(geschichte.author));
{m.journey_badge_list()}
</span>
{/if}
{#if isDraft}
<span
data-testid="draft-badge"
class="inline-flex items-center rounded-sm border border-line bg-canvas px-1.5 py-px font-sans text-xs font-bold tracking-wide text-ink-3 uppercase"
>
{m.geschichten_draft_badge()}
</span>
{/if}
</div>
<!-- Content column -->
<div class="min-w-0 flex-1 p-3 sm:px-4">
<!-- Compact meta line (mobile only) -->
<div class="mb-1 flex items-center gap-1.5 sm:hidden">
<div class="mb-1 flex flex-wrap items-center gap-1.5 sm:hidden">
<!-- 7px initials render as smudge at this size — a plain color dot reads better -->
<span
aria-hidden="true"
@@ -57,6 +66,14 @@ const authorName = $derived(formatAuthorName(geschichte.author));
style="background-color: {personAvatarColor(authorName)}"
></span>
<span class="font-sans text-sm font-semibold text-ink">{authorName}</span>
{#if isDraft}
<span
data-testid="draft-badge-mobile"
class="inline-flex shrink-0 items-center rounded-sm border border-line bg-canvas px-1.5 py-px font-sans text-xs font-bold tracking-wide text-ink-3 uppercase"
>
{m.geschichten_draft_badge()}
</span>
{/if}
{#if publishedAt}
<span class="ml-auto font-sans text-sm text-ink-3">{publishedAt}</span>
{/if}