feat: sort photos by capture date with configurable default sort (#283)

Add per-event default photo sort setting with 6 options:
- Upload Date (Newest/Oldest First)
- Date Taken (Newest/Oldest First) — uses EXIF captured_at
- Filename (A-Z / Z-A)

Backend:
- Migration 077 adds default_photo_sort column to events table
- Event create/update handlers accept and validate the setting
- Gallery info endpoint returns default_photo_sort for frontend

Frontend:
- "Date Taken" added to gallery sort dropdown (alongside Date, Name,
  Size, Rating)
- Gallery initializes with event's default sort instead of hardcoded
  "date"
- "Default Photo Sort" dropdown in event create and edit forms
- Photos without EXIF dates fall back to upload date

i18n: All 5 locales (EN, DE, NL, PT, RU) updated with sort labels.

Closes #283
This commit is contained in:
Paul Nothaft
2026-04-09 15:10:51 +02:00
parent b23c51b386
commit 633d4a0f30
15 changed files with 192 additions and 10 deletions
+5
View File
@@ -60,6 +60,8 @@ export interface Event {
// Client access (#172)
client_access_enabled?: boolean;
client_share_token?: string;
// Default photo sort order
default_photo_sort?: string;
}
export type GalleryAccessLevel = 'guest' | 'client';
@@ -73,6 +75,7 @@ export interface GalleryInfo {
is_expired: boolean;
requires_password?: boolean;
color_theme?: string;
default_photo_sort?: string;
}
export interface Photo {
@@ -151,6 +154,8 @@ export interface GalleryData {
hero_divider_style?: 'wave' | 'straight' | 'angle' | 'curve' | 'none';
// Hero image anchor position (#162) keyword or "X% Y%" focal point
hero_image_anchor?: string;
// Default photo sort order
default_photo_sort?: string;
};
categories?: PhotoCategory[];
photos: Photo[];