Ajout du frontend et branchement sur l'API axione #9

Merged
felix.baylac merged 21 commits from johan/frontend into master 2022-02-13 19:39:12 +01:00
Showing only changes of commit 68b137c8f9 - Show all commits

View file

@ -34,7 +34,7 @@
<div id="methodPto" class="collapse show testMethods">
<h2 class="text-center form-title">Test d'éligibilité par PTO</h2>
<form method="post" action="/test/pto">
<form id="formPtoTest" method="post" action="/test/pto">
<div class="form-group" id="ptoForm">
<label class="form-label" for="pto-number">Numéro PTO</label>
<input autofocus required type="text" class="form-control" name="pto" id="pto-number" aria-describedby="ptoHelp"
@ -53,7 +53,7 @@
</div>
</div>
</div>
<button type="submit" class="btn btn-sable">Tester le PTO</button>
<button id="buttonPtoTest" type="submit" class="btn btn-sable">Tester le PTO</button>
</form>
<br>
@ -208,10 +208,25 @@
});
$('#formAddressTest').submit(function(eventObj) {
// disable button
$("#btnTestAdresse").prop("disabled", true);
// add spinner to button
$("#btnTestAdresse").html(
`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>Test...`
);
$('#formAddressTest').append(`<input type="hidden" class="form-control" name="codeInsee" value="${codeInsee}" />`);
$('#formAddressTest').append(`<input type="hidden" class="form-control" name="codeRivoli" value="${codeRivoli}" />`);
return true;
});
$('#formPtoTest').submit(function(eventObj) {
// disable button
$("#buttonPtoTest").prop("disabled", true);
// add spinner to button
$("#buttonPtoTest").html(
`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>Test...`
);
return true;
});
});
</script>
</body>