From ed99b67926f2ae5cffb80d261915c8d282cd4cd6 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 16 Jul 2026 22:41:31 +0000 Subject: [PATCH] =?UTF-8?q?Alerte=20des=20refus=20de=20droit=20=C3=A0=20l'?= =?UTF-8?q?image=20dans=20la=20gestion=20des=20photos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lorsqu'une rencontre passée est liée à une rencontre, la gestion des photos affiche désormais un avertissement listant les participants ayant refusé la publication de leur image, pour éviter de les faire figurer sur les photos publiées. Les données proviennent des consentements par participant recueillis à l'inscription. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01Fkg15RCxNgUys4ru73He2o --- web/src/components/admin/AdminPast.jsx | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/web/src/components/admin/AdminPast.jsx b/web/src/components/admin/AdminPast.jsx index 673d7a8..c996a6e 100644 --- a/web/src/components/admin/AdminPast.jsx +++ b/web/src/components/admin/AdminPast.jsx @@ -6,7 +6,9 @@ import ImageSlot from '../ImageSlot.jsx'; // Manages the gallery of one past event: unlimited photos, add / delete / // set-as-principal. Only available once the event exists (has an id). -function PhotoManager({ eventId, photos, setPhotos }) { +// `refused` lists participants of the linked rencontre who declined image +// publication, warned about before photos are added. +function PhotoManager({ eventId, photos, setPhotos, refused = [] }) { const { user } = useAuth(); const [error, setError] = useState(''); @@ -46,6 +48,15 @@ function PhotoManager({ eventId, photos, setPhotos }) { return (
+ {refused.length > 0 && ( +
+ ⚠ + + {refused.length} participant{refused.length > 1 ? 's ont' : ' a'} refusé la publication de {refused.length > 1 ? 'leur' : 'son'} image :{' '} + {refused.join(', ')}. Ne {refused.length > 1 ? 'les' : 'le/la'} faites pas figurer sur les photos publiées ici. + +
+ )}
Photos ({photos.length})
{photos.map((p, idx) => ( @@ -82,6 +93,7 @@ function PastEventFormModal({ event, rencontres, onClose, onSaved }) { : { date_label: '', lieu: '', titre: '', texte: '', participants: 0, rencontre_id: '' } ); const [photos, setPhotos] = useState(event?.photos || []); + const [refused, setRefused] = useState([]); const [error, setError] = useState(''); const [savedMsg, setSavedMsg] = useState(false); @@ -89,6 +101,15 @@ function PastEventFormModal({ event, rencontres, onClose, onSaved }) { const linked = form.rencontre_id ? rencontres.find((r) => r.id === Number(form.rencontre_id)) : null; + // When the event is linked to a rencontre, list the participants who + // declined image publication so the admin avoids publishing their photo. + useEffect(() => { + if (!form.rencontre_id) { setRefused([]); return; } + api.get(`/api/admin/rencontres/${form.rencontre_id}/inscriptions`) + .then((d) => setRefused(d.inscriptions.filter((i) => i.image_consent === false).map((i) => i.nom))) + .catch(() => setRefused([])); + }, [form.rencontre_id]); + const submit = async (e) => { e.preventDefault(); setError(''); @@ -176,7 +197,7 @@ function PastEventFormModal({ event, rencontres, onClose, onSaved }) { {savedId && (
- +

La première photo (★ principale) est mise en avant sur la page d'accueil. Le nombre de photos affiché sur le site correspond automatiquement aux photos ci-dessus.