Redaktionskalender für das Redaktionsteam
- Planungen mit Art, Status (Idee → In Arbeit → Zur Freigabe → Geplant → Erledigt), Zuständigkeit, Erscheinungstag, Frist, Notizen und Kommentaren - Monatsansicht mit Planungen, Meldungen (online/geplant/Entwurf) und Terminen; Verschieben per Ziehen & Ablegen oder im Dialog (Tastatur) - Ideenspeicher für Planungen ohne Datum - Board nach Status mit Ziehen & Ablegen, Listenansicht mit Tabelle - Filter nach Person („Nur meine“), Art und erledigten Einträgen - „Meldung daraus erstellen“ legt einen verknüpften Entwurf an - „Meine Aufgaben“ auf der Übersicht, überfällige Fristen hervorgehoben - Demo-Planungen im Seed Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
fdb6b0e70e
commit
7da1a10af2
19 changed files with 2613 additions and 3 deletions
74
src/lib/admin/calendar/BoardView.svelte
Normal file
74
src/lib/admin/calendar/BoardView.svelte
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
<script lang="ts">
|
||||
import Plus from '@lucide/svelte/icons/plus';
|
||||
import EntryChip from './EntryChip.svelte';
|
||||
import { callAction } from '../actions';
|
||||
import { EDITORIAL_STATUS, STATUS_TONE, statusKeys, type CalendarEntry, type EditorialStatus, type TeamMember } from '$lib/editorial';
|
||||
import { formatShort } from '$lib/dates';
|
||||
|
||||
let {
|
||||
plans,
|
||||
team,
|
||||
today,
|
||||
onopen,
|
||||
oncreate
|
||||
}: {
|
||||
plans: CalendarEntry[];
|
||||
team: TeamMember[];
|
||||
today: string;
|
||||
onopen: (e: CalendarEntry) => void;
|
||||
oncreate: (date: string, status?: EditorialStatus) => void;
|
||||
} = $props();
|
||||
|
||||
const columns = $derived(
|
||||
statusKeys.map((s) => ({ status: s, items: plans.filter((p) => p.type === 'plan' && p.status === s) }))
|
||||
);
|
||||
|
||||
let dropTarget = $state<string | null>(null);
|
||||
|
||||
async function drop(e: DragEvent, status: EditorialStatus) {
|
||||
e.preventDefault();
|
||||
dropTarget = null;
|
||||
const raw = e.dataTransfer?.getData('application/x-redaktion');
|
||||
if (!raw) return;
|
||||
const { type, id } = JSON.parse(raw);
|
||||
if (type !== 'plan') return;
|
||||
await callAction('status', { id, status }, `Status: ${EDITORIAL_STATUS[status]}`);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="flex gap-4 overflow-x-auto pb-4 -mx-4 px-4 sm:mx-0 sm:px-0 snap-x">
|
||||
{#each columns as col (col.status)}
|
||||
<section
|
||||
aria-labelledby="col-{col.status}"
|
||||
class="tone-{STATUS_TONE[col.status]} snap-start shrink-0 w-72 rounded-2xl bg-surface-2 p-3 transition-colors {dropTarget === col.status ? 'outline-2 outline-dashed outline-tone bg-tone-soft' : ''}"
|
||||
ondragover={(e) => {
|
||||
if (!e.dataTransfer?.types.includes('application/x-redaktion')) return;
|
||||
e.preventDefault();
|
||||
dropTarget = col.status;
|
||||
}}
|
||||
ondragleave={() => dropTarget === col.status && (dropTarget = null)}
|
||||
ondrop={(e) => drop(e, col.status)}
|
||||
>
|
||||
<header class="flex items-center gap-2 px-1 mb-3">
|
||||
<span class="size-2.5 rounded-full bg-tone" aria-hidden="true"></span>
|
||||
<h2 id="col-{col.status}" class="font-bold text-sm flex-1">{EDITORIAL_STATUS[col.status]}</h2>
|
||||
<span class="text-xs font-bold text-ink-3" aria-label="{col.items.length} Einträge">{col.items.length}</span>
|
||||
<button type="button" class="grid place-items-center size-7 rounded-full text-ink-3 hover:bg-surface hover:text-ink" aria-label="Neuer Eintrag mit Status {EDITORIAL_STATUS[col.status]}" onclick={() => oncreate('', col.status)}>
|
||||
<Plus class="size-4" />
|
||||
</button>
|
||||
</header>
|
||||
<ul class="space-y-2 min-h-16">
|
||||
{#each col.items as entry (entry.id)}
|
||||
<li>
|
||||
<EntryChip {entry} {team} {today} {onopen} />
|
||||
{#if entry.type === 'plan' && entry.date}
|
||||
<span class="sr-only">geplant für {formatShort(entry.date)}</span>
|
||||
{/if}
|
||||
</li>
|
||||
{:else}
|
||||
<li class="text-xs text-ink-3 px-1 py-4 text-center border-2 border-dashed border-line rounded-xl">Hierher ziehen</li>
|
||||
{/each}
|
||||
</ul>
|
||||
</section>
|
||||
{/each}
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue