forked from v4l3n71n/covas-bo
addevents and lists finish
This commit is contained in:
parent
f5135eb85a
commit
6f32a4d1eb
@ -107,13 +107,13 @@
|
|||||||
<div class="position-sticky pt-3 sidebar-sticky">
|
<div class="position-sticky pt-3 sidebar-sticky">
|
||||||
<ul class="nav flex-column">
|
<ul class="nav flex-column">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" aria-current="page" href="#">
|
<a class="nav-link" aria-current="page" href="/html/users.html">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home align-text-bottom" aria-hidden="true"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home align-text-bottom" aria-hidden="true"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
|
||||||
Utilisateurs
|
Utilisateurs
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link active" aria-current="page" href="/html/events.html">
|
<a class="nav-link active" aria-current="page" href="#">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home align-text-bottom" aria-hidden="true"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home align-text-bottom" aria-hidden="true"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
|
||||||
Évènements
|
Évènements
|
||||||
</a>
|
</a>
|
||||||
@ -138,7 +138,7 @@
|
|||||||
|
|
||||||
<h2>Liste d'évènement</h2>
|
<h2>Liste d'évènement</h2>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
|
<div class="row g-3">
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<label for="inputStatus" class="form-label">Statut</label>
|
<label for="inputStatus" class="form-label">Statut</label>
|
||||||
<select class="form-select" id="inputStatus" aria-label="Default select example">
|
<select class="form-select" id="inputStatus" aria-label="Default select example">
|
||||||
@ -159,12 +159,13 @@
|
|||||||
<option value="100">100</option>
|
<option value="100">100</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<button type="button" class="btn btn-success" id="enableUserButton" data-bs-toggle="modal" data-bs-target="#enableUserModal">Activer l'utilisateur</button>
|
<button type="button" class="btn btn-success" id="enableUserButton" data-bs-toggle="modal" data-bs-target="#enableUserModal">Activer l'évènement</button>
|
||||||
|
|
||||||
<button type="button" class="btn btn-warning " id="disableUserButton" data-bs-toggle="modal" data-bs-target="#disableUserModal">Désactiver l'utilisateur</button>
|
<button type="button" class="btn btn-warning " id="disableUserButton" data-bs-toggle="modal" data-bs-target="#disableUserModal">Désactiver l'évènement</button>
|
||||||
<button type="button" class="btn btn-danger" id="removeUserButton" data-bs-toggle="modal" data-bs-target="#removeUserModal">Supprimer l'utilisateur</button>
|
<button type="button" class="btn btn-danger" id="removeUserButton" data-bs-toggle="modal" data-bs-target="#removeUserModal">Supprimer l'évènement</button>
|
||||||
<br /><br /><br />
|
<br /><br /><br />
|
||||||
<table id=users class="table table-striped table-sm">
|
<table id=users class="table table-striped table-sm">
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -6,10 +6,10 @@ pathURL = document.location.pathname.split("/")[document.location.pathname.split
|
|||||||
|
|
||||||
document.getElementById("addUser").addEventListener("click", function(){
|
document.getElementById("addUser").addEventListener("click", function(){
|
||||||
switch (pathURL){
|
switch (pathURL){
|
||||||
case "users":
|
case "user":
|
||||||
var updateProfil = ["username", "email", "firstName", "birth", "password"];
|
var updateProfil = ["username", "email", "firstName", "birth", "password"];
|
||||||
break;
|
break;
|
||||||
case "events":
|
case "event":
|
||||||
var updateProfil = ["name", "place", "start_date", "end_date"];
|
var updateProfil = ["name", "place", "start_date", "end_date"];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -18,7 +18,7 @@ document.getElementById("addUser").addEventListener("click", function(){
|
|||||||
}
|
}
|
||||||
var updateOk = true;
|
var updateOk = true;
|
||||||
for (var i=0; i<updateProfil.length; i++){
|
for (var i=0; i<updateProfil.length; i++){
|
||||||
if(updateProfile[i] == "place"){
|
if(updateProfil[i] == "place"){
|
||||||
size = document.getElementsByClassName("mapboxgl-ctrl-geocoder--input")[0].value.length
|
size = document.getElementsByClassName("mapboxgl-ctrl-geocoder--input")[0].value.length
|
||||||
} else {
|
} else {
|
||||||
size= document.getElementById(updateProfil[i]+"UpdateInput").value.length
|
size= document.getElementById(updateProfil[i]+"UpdateInput").value.length
|
||||||
@ -40,7 +40,7 @@ document.getElementById("addUser").addEventListener("click", function(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch(pathURL){
|
switch(pathURL){
|
||||||
case "users":
|
case "user":
|
||||||
dataPut = {
|
dataPut = {
|
||||||
"username": document.getElementById("usernameUpdateInput").value,
|
"username": document.getElementById("usernameUpdateInput").value,
|
||||||
"email": document.getElementById("emailUpdateInput").value,
|
"email": document.getElementById("emailUpdateInput").value,
|
||||||
@ -51,7 +51,7 @@ document.getElementById("addUser").addEventListener("click", function(){
|
|||||||
"roles": selector["roles"]
|
"roles": selector["roles"]
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case "events":
|
case "event":
|
||||||
dataPut = {
|
dataPut = {
|
||||||
"name": document.getElementById("nameUpdateInput").value,
|
"name": document.getElementById("nameUpdateInput").value,
|
||||||
"place": document.getElementsByClassName("mapboxgl-ctrl-geocoder--input")[0].value,
|
"place": document.getElementsByClassName("mapboxgl-ctrl-geocoder--input")[0].value,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
mapboxgl.accessToken = 'pk.eyJ1IjoidmFsY3plODAiLCJhIjoiY2xpY2FhOTM5MGxwczNrdGV6a2J1Z2Q4diJ9.I_WRpX1aO4z32ajcE2Ef7A';
|
mapboxgl.accessToken = 'pk.eyJ1IjoidmFsY3plODAiLCJhIjoiY2xpY2FhOTM5MGxwczNrdGV6a2J1Z2Q4diJ9.I_WRpX1aO4z32ajcE2Ef7A';
|
||||||
const geocoder = new MapboxGeocoder({
|
const geocoder = new MapboxGeocoder({
|
||||||
accessToken: mapboxgl.accessToken,
|
accessToken: mapboxgl.accessToken,
|
||||||
types: 'country,region,place,postcode,locality,neighborhood'
|
types: 'country,region,place,postcode,locality,neighborhood,poi'
|
||||||
});
|
});
|
||||||
|
|
||||||
geocoder.addTo('#placeUpdateInput');
|
geocoder.addTo('#placeUpdateInput');
|
@ -29,24 +29,26 @@ function buildParam(typeInput){
|
|||||||
listId =["inputRoles", "inputStatus", "inputPages"]
|
listId =["inputRoles", "inputStatus", "inputPages"]
|
||||||
for (var i=0; i<listId.length; i++) {
|
for (var i=0; i<listId.length; i++) {
|
||||||
var select = document.getElementById(listId[i]);
|
var select = document.getElementById(listId[i]);
|
||||||
var getId = select.options[select.selectedIndex].value;
|
if (select != null){
|
||||||
switch (listId[i])
|
var getId = select.options[select.selectedIndex].value;
|
||||||
{
|
switch (listId[i])
|
||||||
case "inputRoles":
|
{
|
||||||
if (getId != "All"){
|
case "inputRoles":
|
||||||
param = param + "roles=" + getId + "&";
|
if (getId != "All"){
|
||||||
}
|
param = param + "roles=" + getId + "&";
|
||||||
break;
|
}
|
||||||
case "inputStatus":
|
break;
|
||||||
if (getId != "-2"){
|
case "inputStatus":
|
||||||
param = param + "status=" + getId + "&";
|
if (getId != "-2"){
|
||||||
}
|
param = param + "status=" + getId + "&";
|
||||||
break;
|
}
|
||||||
case "inputPages":
|
break;
|
||||||
param = param + "limit=" + getId + "&";
|
case "inputPages":
|
||||||
break;
|
param = param + "limit=" + getId + "&";
|
||||||
default:
|
break;
|
||||||
break;
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user