Commit 77424206 authored by Mat's avatar Mat

améliore les boutons, look et confirm

parent 8d92e419
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
let editBtn = document.createElement('button'); let editBtn = document.createElement('button');
editBtn.innerHTML = '<i class="fas fa-edit fa-fw"></i> Editer'; editBtn.innerHTML = '<i class="fas fa-edit fa-fw"></i> Editer';
editBtn.classList.add('btn', 'btn-primary', 'btn-sm'); editBtn.classList.add('btn', 'btn-dark', 'btn-sm');
editBtn.dataset.membreId = json[i].id; editBtn.dataset.membreId = json[i].id;
editBtn.addEventListener('click', function(e) editBtn.addEventListener('click', function(e)
{ {
...@@ -154,13 +154,14 @@ ...@@ -154,13 +154,14 @@
td6.appendChild(editBtn); td6.appendChild(editBtn);
let deleteBtn = document.createElement('button'); let deleteBtn = document.createElement('button');
deleteBtn.innerHTML = '<i class="fas fa-trash fa-fw"></i> Supprimer'; deleteBtn.innerHTML = '<i class="fas fa-trash fa-fw"></i>';
deleteBtn.classList.add('btn', 'btn-danger', 'btn-sm'); deleteBtn.classList.add('btn', 'btn-danger', 'btn-sm');
deleteBtn.dataset.membreId = json[i].id; deleteBtn.dataset.membreId = json[i].id;
deleteBtn.addEventListener('click', function(e) deleteBtn.addEventListener('click', function(e)
{ {
let membreId = this.dataset.membreId; let membreId = this.dataset.membreId;
let r = confirm('Are you sure ?'); let r = confirm('Effacer le membre n°' + membreId
+ '\nCette action n\'est pas réversible. Souhaitez-vous continuer ?\n');
if (r === true) { if (r === true) {
submitURL = Routing.generate('api_membre_delete', {'id': membreId }); submitURL = Routing.generate('api_membre_delete', {'id': membreId });
AJAX('DELETE', submitURL, function() AJAX('DELETE', submitURL, function()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment