From c21ddc5b7eb0c59211f4b7283b5959bf31b3f969 Mon Sep 17 00:00:00 2001 From: puttaalu Date: Sun, 18 Oct 2026 23:29:04 +0200 Subject: [PATCH] Add bulk (multi-photo) upload to the web form MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The /upload page now takes several photos at once, mirroring the Android and Qt apps: a card per photo with its own preview, EXIF-prefilled date, caption and tag-autocompleting tags field, a remove button, and per-photo status. "Post photos" uploads them sequentially with an x/N progress line; failures can be retried by pressing Post again, successes link straight to the new photo page. No server change — each photo is still a separate POST /upload, exactly as the apps' per-photo queue does it, so slugs come from filenames as before. --- CLAUDE.md | 4 +- README.md | 2 +- templates/upload.html | 408 ++++++++++++++++++++---------------------- 3 files changed, 198 insertions(+), 216 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 8496129..b3dba64 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -19,7 +19,9 @@ The binary does three things at once: - Serves a multipart upload API at `POST /upload` - In dev mode (`--serve`), also serves `public/` as static files -Routes: `GET /upload` (HTML upload form), `POST /upload` (multipart), +Routes: `GET /upload` (HTML upload form — multi-photo: the page posts one +`POST /upload` per selected photo, each with its own caption/date/tags), +`POST /upload` (multipart, one image per request), `GET /manage` (edit/delete UI), the manage API under `/api/` (see Manage), `GET /health`. Every route except `/health` is gated by HTTP Basic auth when `-htpasswd` is set (see Auth). diff --git a/README.md b/README.md index f832d4d..81be958 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ database, no framework. **Content & management (no database)** - `.toml` sidecars are the source of truth; the binary watches the content dir and rebuilds on any change. Four renditions per photo (original, 600² thumbnail, 1600px medium, 1200px OG), each skipped when already up to date. -- **Web upload** (`/upload`) with EXIF-date prefill and tag autocomplete. +- **Web upload** (`/upload`): pick one or many photos, each with its own EXIF-prefilled date, caption and tag-autocompleting tags field; posted with per-photo status and retry. - **Manage UI** (`/manage`): edit caption/date/tags, bulk tag add/remove, and delete — delete is reversible (moves to `content/.trash/`, with restore / empty). - Tag autocomplete across the upload and manage forms, fed by `/tags.json`. diff --git a/templates/upload.html b/templates/upload.html index 681eb3c..2d5fcc8 100644 --- a/templates/upload.html +++ b/templates/upload.html @@ -10,177 +10,219 @@
← Gallery -

Upload photo

+

Upload photos

-
- -
- -

Click to choose a photo

- jpg or png -
- Preview -
Click to change
+ + + +
No photos selected
+
+ + - -
- - -
- -
- - -
- -
- - -
- - -