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:
parent
cd393e4ab2
commit
eaff23839f
26 changed files with 1234 additions and 22 deletions
|
|
@ -32,6 +32,7 @@ what a dropdown in the admin editor says.
|
|||
| The **label** a dropdown shows in the admin | code | [one file](#renaming-what-a-dropdown-shows) |
|
||||
| The **list of allowed values** behind a fixed dropdown | database CHECK + code | [a migration and three files](#adding-removing-or-renaming-a-stored-value) |
|
||||
| Navigation, page section titles, colours, the site banner, history decades, the map grid | code | [the file named below](#other-content-that-lives-in-code) |
|
||||
| Uploaded images | disk + the `media` table | Admin → Media, or any image field. See `docs/media-uploads.md` |
|
||||
|
||||
The rule of thumb from `CLAUDE.md`: data belongs in the database,
|
||||
presentation belongs in code. A dropdown's *values* are data the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue