Add image uploads with a media library, and event card backgrounds

Uploads (migration 028, server/src/media.js, routes/media.js): editors
and up upload JPEG, PNG, GIF, WebP or SVG. Photos are resized to 2400px
and saved as WebP by default, or kept as uploaded on request. Files
live in UPLOADS_DIR, served by nginx in production and by the API in
dev. Admins and up delete, after seeing what still uses the file.

Every image field in the editor is now an image widget: preview, the
path as text, Upload and Choose from library. A new Media page lists
the library. Org lists and event cards now resolve logos through
media.ts, so uploaded paths work there.

Events get a card_image (migration 029): a photo behind the card under
a light veil so the text stays readable. The card's size is unchanged.

Setup for production is in docs/media-uploads.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-27 15:04:45 -05:00
parent cd393e4ab2
commit eaff23839f
26 changed files with 1234 additions and 22 deletions

View file

@ -115,3 +115,9 @@ export function patch(path, data) {
export function del(path) {
return request(path, { method: "DELETE" });
}
/* A multipart body. No Content-Type here: the browser sets it,
boundary included, from the FormData itself. */
export function upload(path, form: FormData) {
return request(path, { method: "POST", body: form });
}