feat: replace native date inputs with shadcn date picker

Add calendar + popover components and a custom DateTimePicker wrapper.
Video forms use date-only; article forms include a time picker.
Also add video player preview to the video edit form.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 17:03:35 +01:00
parent e943876e70
commit 609f116b5d
33 changed files with 799 additions and 15 deletions

View File

@@ -11,6 +11,7 @@
import { FileDropZone, MEGABYTE } from "$lib/components/ui/file-drop-zone";
import { getAssetUrl } from "$lib/api";
import { Select, SelectContent, SelectItem, SelectTrigger } from "$lib/components/ui/select";
import { DatePicker } from "$lib/components/ui/date-picker";
const { data } = $props();
@@ -124,7 +125,12 @@
<div class="space-y-1.5">
<Label>{$_("admin.video_form.video_file")}</Label>
{#if movieId}
<p class="text-xs text-muted-foreground mb-1">{$_("admin.video_form.current_file", { values: { id: movieId } })}</p>
<video
src={getAssetUrl(movieId)}
poster={imageId ? getAssetUrl(imageId, "preview") ?? undefined : undefined}
controls
class="w-full rounded-lg bg-black max-h-72 mb-2"
></video>
{/if}
<FileDropZone accept="video/*" maxFileSize={2000 * MEGABYTE} onUpload={handleVideoUpload} />
</div>
@@ -135,8 +141,8 @@
</div>
<div class="space-y-1.5">
<Label for="uploadDate">{$_("admin.common.publish_date")}</Label>
<Input id="uploadDate" type="datetime-local" bind:value={uploadDate} />
<Label>{$_("admin.common.publish_date")}</Label>
<DatePicker bind:value={uploadDate} placeholder={$_("admin.common.publish_date")} showTime={false} />
</div>
<div class="flex gap-6">