Gestion evenements + cadres par event + fix cadre paysage + dossier non-imprimees
- CRUD evenements : creer, activer, editer, supprimer dans panneau admin - Cadres specifiques par evenement (aucun/disponible/defaut/impose) - Fix cadre paysage deformé : rotation auto si orientation ne correspond pas - Photos non imprimees vont dans sous-dossier "non_imprimees" (USB/FTP) au lieu d'etre ignorees ; booth recoit toujours toutes les photos Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -35,13 +35,25 @@ function annulerCadreImpression() {
|
||||
async function chargerCadresChoixImpression() {
|
||||
const fmt = (config.impression?.format || '15x20').replace('-2up', '');
|
||||
const data = await apiGet(`/api/cadres-impression/${fmt}`).catch(() => null);
|
||||
if (!data || data.disponibles.length === 0) return false;
|
||||
if (!data) return false;
|
||||
|
||||
// Mode impose : pas de choix, cadre force
|
||||
if (data.event_mode === 'impose' && data.event_cadre) {
|
||||
cadreChoisi = data.event_cadre;
|
||||
return false;
|
||||
}
|
||||
|
||||
const tousLesGlobaux = data.disponibles || [];
|
||||
const tousLesEvent = data.event_cadres || [];
|
||||
if (tousLesGlobaux.length === 0 && tousLesEvent.length === 0) return false;
|
||||
|
||||
const grille = document.getElementById('grille-cadres-impression');
|
||||
grille.innerHTML = '';
|
||||
|
||||
const eventCadreDefaut = (data.event_mode === 'defaut') ? data.event_cadre : null;
|
||||
|
||||
const divAucun = document.createElement('div');
|
||||
divAucun.className = 'cadre-choix-item cadre-choix-aucun cadre-selectionne';
|
||||
divAucun.className = 'cadre-choix-item cadre-choix-aucun' + (!eventCadreDefaut ? ' cadre-selectionne' : '');
|
||||
divAucun.innerHTML = '<div class="cadre-choix-vide"></div><span>Sans cadre</span>';
|
||||
divAucun.onclick = () => {
|
||||
cadreChoisi = null;
|
||||
@@ -50,7 +62,23 @@ async function chargerCadresChoixImpression() {
|
||||
};
|
||||
grille.appendChild(divAucun);
|
||||
|
||||
for (const nom of data.disponibles) {
|
||||
// Cadres evenement
|
||||
for (const nom of tousLesEvent) {
|
||||
const isDefaut = (nom === eventCadreDefaut);
|
||||
const div = document.createElement('div');
|
||||
div.className = 'cadre-choix-item' + (isDefaut ? ' cadre-selectionne' : '');
|
||||
div.innerHTML = `<div class="cadre-thumb-wrap"><img src="/data/evenements/${data.event_id}/cadres/${fmt}/${nom}" alt="${nom}"></div><span>${nom.replace('.png','')}</span>`;
|
||||
div.onclick = () => {
|
||||
cadreChoisi = nom;
|
||||
grille.querySelectorAll('.cadre-choix-item').forEach(el => el.classList.remove('cadre-selectionne'));
|
||||
div.classList.add('cadre-selectionne');
|
||||
};
|
||||
grille.appendChild(div);
|
||||
if (isDefaut) cadreChoisi = nom;
|
||||
}
|
||||
|
||||
// Cadres globaux
|
||||
for (const nom of tousLesGlobaux) {
|
||||
const div = document.createElement('div');
|
||||
div.className = 'cadre-choix-item';
|
||||
div.innerHTML = `<div class="cadre-thumb-wrap"><img src="/assets/cadres/${fmt}/${nom}" alt="${nom}"></div><span>${nom.replace('.png','')}</span>`;
|
||||
|
||||
Reference in New Issue
Block a user