forked from v4l3n71n/covas-bo
add selected input wip
This commit is contained in:
parent
e590b3f823
commit
64762778d0
@ -159,20 +159,24 @@
|
||||
<table id=users class="table table-striped table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" id="checkboxPrincipal" aria-label="Checkbox for following text input"></th>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">Pseudo</th>
|
||||
<th scope="col">Username</th>
|
||||
<th scope="col">Mail</th>
|
||||
<th scope="col">Rôle</th>
|
||||
<th scope="col">Statut</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><input type="checkbox" class="checkboxList" aria-label="Checkbox for following text input"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><span class="activeStatus hidden">Activé</span><span class="disableStatus hidden">Désactivé</span><span class="confirmStatus hidden">En attente de confirmation</span><span class="removeStatus hidden">En attente de suppression</span><span class="unknownStatus hidden">Statut inconnu</span></td>
|
||||
<td><button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#updateUserModal">Modifier</button></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
|
@ -96,10 +96,10 @@ instance.get("users", {withCredentials: true, params:param}).then(function(respo
|
||||
}
|
||||
var trAll = document.querySelectorAll("#users tbody tr")
|
||||
td = trAll[i].querySelectorAll("td");
|
||||
td[0].textContent = listData[i].id;
|
||||
td[1].textContent = listData[i].username;
|
||||
td[2].textContent = listData[i].email;
|
||||
td[3].textContent = listData[i].roles;
|
||||
td[1].textContent = listData[i].id;
|
||||
td[2].textContent = listData[i].username;
|
||||
td[3].textContent = listData[i].email;
|
||||
td[4].textContent = listData[i].roles;
|
||||
var classTd = "";
|
||||
switch(listData[i].status){
|
||||
case 1:
|
||||
@ -118,11 +118,11 @@ instance.get("users", {withCredentials: true, params:param}).then(function(respo
|
||||
classTd = ".unknownStatus"
|
||||
break;
|
||||
}
|
||||
td[4].querySelector(".activeStatus").classList.add("hidden");
|
||||
td[4].querySelector(classTd).classList.remove("hidden");
|
||||
td[5].querySelector(".activeStatus").classList.add("hidden");
|
||||
td[5].querySelector(classTd).classList.remove("hidden");
|
||||
|
||||
trAll[i].addEventListener("click", function(e){
|
||||
var id = e.currentTarget.querySelector("td").textContent;
|
||||
var id = e.currentTarget.querySelectorAll("td")[1].textContent;
|
||||
location.href="/html/user.html?id="+id;
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user