diff --git a/static/img/schedule.png b/static/img/schedule.png index ae19131..143eb3d 100644 Binary files a/static/img/schedule.png and b/static/img/schedule.png differ diff --git a/static/index.html b/static/index.html index 69e8865..cc3a01b 100644 --- a/static/index.html +++ b/static/index.html @@ -145,7 +145,7 @@
- +
diff --git a/static/js/main.js b/static/js/main.js index 7486e0b..de882cd 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -526,7 +526,7 @@ $('#demande-button').click(function () { amount: $('#demande-amount').val(), where: $('#demande-where').val(), supplement: $('#demande-supp').val(), - note: $('#demande-note').val(), + note: $('#demande-notes').val(), }), contentType: "application/json; charset=utf-8", dataType: "json", @@ -569,20 +569,50 @@ function updateDemandes() { let pd = data.prankData; for(const pd_uid in pd) { $('#demande-list').append(` - +

Demande de crêpe

Quantité: ${pd[pd_uid].amount}
Garniture: ${pd[pd_uid].supplement}
Livraison: ${pd[pd_uid].where}
Notes: ${pd[pd_uid].note}
-
Statue: ${pd[pd_uid].state}
-
+
Statue: ${pd[pd_uid].state}
+ ${ (pd[pd_uid].state != "Accepted" && pd[pd_uid].state != "Refused" ) ? + ` +
Supprimer
+
` + : '' + }
`) + + $('#' + pd_uid + " .prank-btn-delete").click(() => { + $.ajax({ + type: 'POST', + url: base_url + 'delPrank', + data: JSON.stringify({ + uid: localStorage.getItem('user'), + token: localStorage.getItem('token'), + prankUid: pd_uid + + }), + contentType: "application/json; charset=utf-8", + dataType: "json", + + success: function(data) { + if (data.success) { + updateDemandes(); + } + else { + alter(data.why); + } + } + + }); + }); } } else { - console.alert(data.why); + console.error(data.why); } }