diff --git a/web/html/home.html b/web/html/home.html index 852635a..f61c705 100644 --- a/web/html/home.html +++ b/web/html/home.html @@ -165,7 +165,7 @@ - + diff --git a/web/js/home.js b/web/js/home.js index 3a5cf9b..ccab1d8 100644 --- a/web/js/home.js +++ b/web/js/home.js @@ -33,10 +33,24 @@ instance.get("users", {withCredentials: true, params :{ page:0, nbPages: nbPages td[1].textContent = listData[i].pseudo td[2].textContent = listData[i].email td[3].textContent = listData[i].roles - var classTd = ".disableStatus"; - if(listData[i].status){ - classTd = ".activeStatus"; - } + var classTd = ""; + switch(listData[i].status){ + case 1: + classTd = ".activeStatus"; + break; + case 0: + classTd = ".disableStatus"; + break; + case 2: + classTd = ".confirmStatus"; + break; + case -1: + classTd = ".removeStatus"; + break; + default: + classTd = ".unknownStatus" + break; + } td[4].querySelector(classTd).classList.remove("hidden"); trAll[i].addEventListener("click", function(e){