forked from ScoDoc/ScoDoc
Assiduite: fix ajout justificatif #705
This commit is contained in:
parent
2e7e00eb0a
commit
cd0b8b7ca9
@ -1,5 +1,5 @@
|
||||
{% include "assiduites/widgets/toast.j2" %}
|
||||
{% block pageContent %}
|
||||
|
||||
<div class="pageContent">
|
||||
<h3>Justifier des assiduités</h3>
|
||||
{% include "assiduites/widgets/tableau_base.j2" %}
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
<fieldset>
|
||||
<div class="justi-row">
|
||||
<button onclick="validerFormulaire()">Créer le justificatif</button>
|
||||
<button onclick="validerFormulaire(this)">Créer le justificatif</button>
|
||||
<button onclick="effacerFormulaire()">Remettre à zero</button>
|
||||
</div>
|
||||
<div class="justi-row">
|
||||
@ -153,6 +153,7 @@
|
||||
|
||||
const requests = []
|
||||
Array.from(in_files.files).forEach((f) => {
|
||||
pushToast(generateToast(document.createTextNode(`Importation du fichier : ${f.name} commencée`), color = "#f0c865"));
|
||||
const fd = new FormData();
|
||||
fd.append('file', f);
|
||||
requests.push(
|
||||
@ -164,22 +165,22 @@
|
||||
dateType: 'json',
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: () => { console.log("done") },
|
||||
success: () => {
|
||||
pushToast(generateToast(document.createTextNode(`Importation du fichier : ${f.name} finie`)));
|
||||
loadAll();
|
||||
},
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
});
|
||||
|
||||
$.when(
|
||||
requests
|
||||
).done(() => {
|
||||
if (in_files.files.length == 0) {
|
||||
loadAll();
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function validerFormulaire() {
|
||||
function validerFormulaire(btn) {
|
||||
if (!validateFields()) return
|
||||
|
||||
const justificatif = fieldsToJustificatif();
|
||||
@ -198,6 +199,12 @@
|
||||
return;
|
||||
}
|
||||
})
|
||||
|
||||
btn.disabled = true;
|
||||
setTimeout(() => {
|
||||
btn.disabled = false;
|
||||
}, 1000)
|
||||
|
||||
}
|
||||
|
||||
function effacerFormulaire() {
|
||||
|
Loading…
Reference in New Issue
Block a user