forked from v4l3n71n/covas-bo
remove data-bs-dismiss
This commit is contained in:
parent
10180c917f
commit
b9aefc1dcd
@ -120,27 +120,37 @@
|
|||||||
|
|
||||||
<div class="alert alert-warning alert-dismissible hidden" id="notModifiedAlert" role="alert">
|
<div class="alert alert-warning alert-dismissible hidden" id="notModifiedAlert" role="alert">
|
||||||
<div>Utilisateur non modifié</div>
|
<div>Utilisateur non modifié</div>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
<button type="button" class="btn-close" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="alert alert-warning alert-dismissible hidden" id="pseudoExistAlert" role="alert">
|
||||||
|
<div>Pseudo déjà pris</div>
|
||||||
|
<button type="button" class="btn-close" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="alert alert-warning alert-dismissible hidden" id="emailExistAlert" role="alert">
|
||||||
|
<div>Email déjà pris</div>
|
||||||
|
<button type="button" class="btn-close" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="alert alert-danger alert-dismissible hidden" id="notAuthorizedAlert" role="alert">
|
<div class="alert alert-danger alert-dismissible hidden" id="notAuthorizedAlert" role="alert">
|
||||||
<div>Action non autorisée</div>
|
<div>Action non autorisée</div>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
<button type="button" class="btn-close" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="alert alert-danger alert-dismissible hidden" id="forbiddenAlert" role="alert">
|
<div class="alert alert-danger alert-dismissible hidden" id="forbiddenAlert" role="alert">
|
||||||
<div>Action interdite</div>
|
<div>Action interdite</div>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
<button type="button" class="btn-close" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="alert alert-danger alert-dismissible hidden" id="internalServerAlert" role="alert">
|
<div class="alert alert-danger alert-dismissible hidden" id="internalServerAlert" role="alert">
|
||||||
<div>Erreur interne du serveur</div>
|
<div>Erreur interne du serveur</div>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
<button type="button" class="btn-close" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="alert alert-danger alert-dismissible hidden" id="unknownAlert" role="alert">
|
<div class="alert alert-danger alert-dismissible hidden" id="unknownAlert" role="alert">
|
||||||
<div>Erreur inconnue</div>
|
<div>Erreur inconnue</div>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
<button type="button" class="btn-close" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@ -125,49 +125,49 @@
|
|||||||
|
|
||||||
<div class="alert alert-danger alert-dismissible hidden" id="notAuthorizedAlert" role="alert">
|
<div class="alert alert-danger alert-dismissible hidden" id="notAuthorizedAlert" role="alert">
|
||||||
<div>Création d'utilisateur non autorisée avec ce compte</div>
|
<div>Création d'utilisateur non autorisée avec ce compte</div>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
<button type="button" class="btn-close" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="alert alert-danger alert-dismissible hidden" id="forbiddenAlert" role="alert">
|
<div class="alert alert-danger alert-dismissible hidden" id="forbiddenAlert" role="alert">
|
||||||
<div>Action interdite</div>
|
<div>Action interdite</div>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
<button type="button" class="btn-close" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="alert alert-danger alert-dismissible hidden" id="noContentAlert" role="alert">
|
<div class="alert alert-danger alert-dismissible hidden" id="noContentAlert" role="alert">
|
||||||
<div>Utilisateur non modifié</div>
|
<div>Utilisateur non modifié</div>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
<button type="button" class="btn-close" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="alert alert-danger alert-dismissible hidden" id="internalServerAlert" role="alert">
|
<div class="alert alert-danger alert-dismissible hidden" id="internalServerAlert" role="alert">
|
||||||
<div>Erreur interne du serveur</div>
|
<div>Erreur interne du serveur</div>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
<button type="button" class="btn-close" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="alert alert-danger alert-dismissible hidden" id="unknownAlert" role="alert">
|
<div class="alert alert-danger alert-dismissible hidden" id="unknownAlert" role="alert">
|
||||||
<div>Erreur inconnue</div>
|
<div>Erreur inconnue</div>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
<button type="button" class="btn-close" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="alert alert-danger alert-dismissible hidden" id="pseudoAlert" role="alert">
|
<div class="alert alert-danger alert-dismissible hidden" id="pseudoAlert" role="alert">
|
||||||
<div>Champ pseudo vide</div>
|
<div>Champ pseudo vide</div>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
<button type="button" class="btn-close" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="alert alert-danger alert-dismissible hidden" id="emailAlert" role="alert">
|
<div class="alert alert-danger alert-dismissible hidden" id="emailAlert" role="alert">
|
||||||
<div>Champ email vide</div>
|
<div>Champ email vide</div>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
<button type="button" class="btn-close" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="alert alert-danger alert-dismissible hidden" id="firstNameAlert" role="alert">
|
<div class="alert alert-danger alert-dismissible hidden" id="firstNameAlert" role="alert">
|
||||||
<div>Champ prenom vide</div>
|
<div>Champ prenom vide</div>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
<button type="button" class="btn-close" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="alert alert-danger alert-dismissible hidden" id="nameAlert" role="alert">
|
<div class="alert alert-danger alert-dismissible hidden" id="nameAlert" role="alert">
|
||||||
<div>Champ nom vide</div>
|
<div>Champ nom vide</div>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
<button type="button" class="btn-close" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
checkToken();
|
checkToken();
|
||||||
signOut();
|
signOut();
|
||||||
|
closeButton();
|
||||||
|
|
||||||
|
|
||||||
document.getElementById("addUser").addEventListener("click", function(){
|
document.getElementById("addUser").addEventListener("click", function(){
|
||||||
@ -60,8 +61,15 @@ document.getElementById("addUser").addEventListener("click", function(){
|
|||||||
}
|
}
|
||||||
document.getElementById(idAlert+"Alert").classList.remove("hidden");
|
document.getElementById(idAlert+"Alert").classList.remove("hidden");
|
||||||
}).catch(function(error){
|
}).catch(function(error){
|
||||||
switch(error.status){
|
console.log(error);
|
||||||
|
switch(error.response.status){
|
||||||
case 401:
|
case 401:
|
||||||
|
listExist = [ "pseudo", "email" ];
|
||||||
|
for(var i=0; i<listExist.length; i++){
|
||||||
|
if(error.response.data[listExist[i]]){
|
||||||
|
document.getElementById(listExist[i]+"ExistAlert").classList.remove("hidden");
|
||||||
|
}
|
||||||
|
}
|
||||||
idAlert="notAuthorized";
|
idAlert="notAuthorized";
|
||||||
break;
|
break;
|
||||||
case 403:
|
case 403:
|
||||||
|
@ -11,6 +11,11 @@ function checkToken(){
|
|||||||
if(location.pathname != "/"){
|
if(location.pathname != "/"){
|
||||||
location.href="/";
|
location.href="/";
|
||||||
}
|
}
|
||||||
|
if(error.response.status == 406){
|
||||||
|
instance.delete("token" , {withCredentials:true}).then(function(response){
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -20,8 +25,8 @@ function signOut(){
|
|||||||
|
|
||||||
document.getElementById("signout").addEventListener("click", function(){
|
document.getElementById("signout").addEventListener("click", function(){
|
||||||
instance.delete("token" , {withCredentials:true}).then(function(response){
|
instance.delete("token" , {withCredentials:true}).then(function(response){
|
||||||
if(response.status == 200){
|
if(response.status == 200) {
|
||||||
location.href="/"
|
location.href="/";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user