Actualiser js/admin.js

This commit is contained in:
2026-06-22 15:13:47 +02:00
parent 4f54209690
commit 3c30b4d40c
+5 -5
View File
@@ -252,7 +252,7 @@ function switchAdminTab(tabName) {
const physicalFilter = document.getElementById('admin-physical-checkbox');
physicalFilter.checked = false;
const wrapper = document.getElementById('physical-filter-wrapper');
const wrapper = document.querySelector('.physical-filter-admin');
if (wrapper) wrapper.style.display = (tabName === 'videotheque') ? 'none' : 'flex';
document.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active'));
@@ -343,8 +343,7 @@ async function handleCritiqueUpload(input) {
if (!input.files || input.files.length === 0) return;
let allData = [];
for (const file of input.files) { try { allData = allData.concat(parseCSV(await file.text())); } catch(e) {} }
input.value = '';
if (allData.length === 0) return alert('❌ Fichier vide.');
if (allData.length === 0) { input.value = ''; return alert('❌ Fichier vide.'); }
showImportModal(allData.length, 'critique');
let processed = 0;
@@ -356,6 +355,7 @@ async function handleCritiqueUpload(input) {
processed += batch.length;
updateImportModal(processed, allData.length);
}
input.value = '';
closeImportModal();
alert(`${allData.length} critique(s) importée(s).`);
loadDashboardData();
@@ -368,8 +368,7 @@ async function handleVideothequeUpload(input) {
if (!input.files || input.files.length === 0) return;
let allData = [];
for (const file of input.files) { try { allData = allData.concat(parseCSV(await file.text())); } catch(e) {} }
input.value = '';
if (allData.length === 0) return alert('❌ Fichier vide.');
if (allData.length === 0) { input.value = ''; return alert('❌ Fichier vide.'); }
showImportModal(allData.length, 'videotheque');
let processed = 0;
@@ -381,6 +380,7 @@ async function handleVideothequeUpload(input) {
processed += batch.length;
updateImportModal(processed, allData.length);
}
input.value = '';
closeImportModal();
alert(`${allData.length} support(s) importé(s).`);
loadDashboardData();