Actualiser js/admin.js
This commit is contained in:
+5
-5
@@ -252,7 +252,7 @@ function switchAdminTab(tabName) {
|
|||||||
|
|
||||||
const physicalFilter = document.getElementById('admin-physical-checkbox');
|
const physicalFilter = document.getElementById('admin-physical-checkbox');
|
||||||
physicalFilter.checked = false;
|
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';
|
if (wrapper) wrapper.style.display = (tabName === 'videotheque') ? 'none' : 'flex';
|
||||||
|
|
||||||
document.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active'));
|
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;
|
if (!input.files || input.files.length === 0) return;
|
||||||
let allData = [];
|
let allData = [];
|
||||||
for (const file of input.files) { try { allData = allData.concat(parseCSV(await file.text())); } catch(e) {} }
|
for (const file of input.files) { try { allData = allData.concat(parseCSV(await file.text())); } catch(e) {} }
|
||||||
input.value = '';
|
if (allData.length === 0) { input.value = ''; return alert('❌ Fichier vide.'); }
|
||||||
if (allData.length === 0) return alert('❌ Fichier vide.');
|
|
||||||
|
|
||||||
showImportModal(allData.length, 'critique');
|
showImportModal(allData.length, 'critique');
|
||||||
let processed = 0;
|
let processed = 0;
|
||||||
@@ -356,6 +355,7 @@ async function handleCritiqueUpload(input) {
|
|||||||
processed += batch.length;
|
processed += batch.length;
|
||||||
updateImportModal(processed, allData.length);
|
updateImportModal(processed, allData.length);
|
||||||
}
|
}
|
||||||
|
input.value = '';
|
||||||
closeImportModal();
|
closeImportModal();
|
||||||
alert(`✅ ${allData.length} critique(s) importée(s).`);
|
alert(`✅ ${allData.length} critique(s) importée(s).`);
|
||||||
loadDashboardData();
|
loadDashboardData();
|
||||||
@@ -368,8 +368,7 @@ async function handleVideothequeUpload(input) {
|
|||||||
if (!input.files || input.files.length === 0) return;
|
if (!input.files || input.files.length === 0) return;
|
||||||
let allData = [];
|
let allData = [];
|
||||||
for (const file of input.files) { try { allData = allData.concat(parseCSV(await file.text())); } catch(e) {} }
|
for (const file of input.files) { try { allData = allData.concat(parseCSV(await file.text())); } catch(e) {} }
|
||||||
input.value = '';
|
if (allData.length === 0) { input.value = ''; return alert('❌ Fichier vide.'); }
|
||||||
if (allData.length === 0) return alert('❌ Fichier vide.');
|
|
||||||
|
|
||||||
showImportModal(allData.length, 'videotheque');
|
showImportModal(allData.length, 'videotheque');
|
||||||
let processed = 0;
|
let processed = 0;
|
||||||
@@ -381,6 +380,7 @@ async function handleVideothequeUpload(input) {
|
|||||||
processed += batch.length;
|
processed += batch.length;
|
||||||
updateImportModal(processed, allData.length);
|
updateImportModal(processed, allData.length);
|
||||||
}
|
}
|
||||||
|
input.value = '';
|
||||||
closeImportModal();
|
closeImportModal();
|
||||||
alert(`✅ ${allData.length} support(s) importé(s).`);
|
alert(`✅ ${allData.length} support(s) importé(s).`);
|
||||||
loadDashboardData();
|
loadDashboardData();
|
||||||
|
|||||||
Reference in New Issue
Block a user