feat(post-form): require 1–6 photos per entry

Raise the FilePond limit from 4 to 6 and enforce a minimum of one photo.
The photo field is first in the form, so initValidation checks it first: an
empty picker blocks submit, reveals the (possibly collapsed) photo section,
and shows "Add at least one photo." under its header. Labels updated to
"Photos (1–6)".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-04 20:59:01 +02:00
co-authored by Claude Opus 4.8
parent 1cde137daa
commit 8b037511fd
3 changed files with 67 additions and 36 deletions
+4 -2
View File
@@ -24,7 +24,7 @@ form:
# bar so the thumbnails don't crowd the writing area.
-
name: photos
label: Photos (max 4)
label: Photos (16)
# Grav-managed filepond field. post-form.js hooks its beforeAddFile
# to convert HEIC->JPEG in the browser, then re-adds the JPEG via the
# public pond.addFile() API — FilePond keeps ownership of the upload
@@ -32,7 +32,9 @@ form:
type: filepond
multiple: true
destination: '@self'
limit: 4
# Max 6 photos per entry; at least 1 is required (enforced
# client-side in post-form.js initValidation).
limit: 6
accept:
- 'image/*'