Update opolka/ScoDoc from ScoDoc/ScoDoc #2

Merged
opolka merged 1272 commits from ScoDoc/ScoDoc:master into master 2024-05-27 09:11:04 +02:00
Showing only changes of commit cd0b8b7ca9 - Show all commits

View File

@ -1,5 +1,5 @@
{% include "assiduites/widgets/toast.j2" %}
{% block pageContent %} {% block pageContent %}
<div class="pageContent"> <div class="pageContent">
<h3>Justifier des assiduités</h3> <h3>Justifier des assiduités</h3>
{% include "assiduites/widgets/tableau_base.j2" %} {% include "assiduites/widgets/tableau_base.j2" %}
@ -12,7 +12,7 @@
<fieldset> <fieldset>
<div class="justi-row"> <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> <button onclick="effacerFormulaire()">Remettre à zero</button>
</div> </div>
<div class="justi-row"> <div class="justi-row">
@ -153,6 +153,7 @@
const requests = [] const requests = []
Array.from(in_files.files).forEach((f) => { Array.from(in_files.files).forEach((f) => {
pushToast(generateToast(document.createTextNode(`Importation du fichier : ${f.name} commencée`), color = "#f0c865"));
const fd = new FormData(); const fd = new FormData();
fd.append('file', f); fd.append('file', f);
requests.push( requests.push(
@ -164,22 +165,22 @@
dateType: 'json', dateType: 'json',
contentType: false, contentType: false,
processData: false, processData: false,
success: () => { console.log("done") }, success: () => {
pushToast(generateToast(document.createTextNode(`Importation du fichier : ${f.name} finie`)));
loadAll();
},
} }
) )
) )
}); });
if (in_files.files.length == 0) {
$.when(
requests
).done(() => {
loadAll(); loadAll();
}) }
} }
function validerFormulaire() { function validerFormulaire(btn) {
if (!validateFields()) return if (!validateFields()) return
const justificatif = fieldsToJustificatif(); const justificatif = fieldsToJustificatif();
@ -198,6 +199,12 @@
return; return;
} }
}) })
btn.disabled = true;
setTimeout(() => {
btn.disabled = false;
}, 1000)
} }
function effacerFormulaire() { function effacerFormulaire() {