From 7626d55a1bca016538d9173e6ef635e7400e578b Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Fri, 3 Nov 2023 22:06:20 +0100 Subject: [PATCH 01/23] add menu events --- web/html/adduser.html | 7 ++++++- web/html/user.html | 7 +++++++ web/html/users.html | 9 ++++++--- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/web/html/adduser.html b/web/html/adduser.html index c9a56c2..512e852 100644 --- a/web/html/adduser.html +++ b/web/html/adduser.html @@ -109,7 +109,12 @@ Utilisateurs - + diff --git a/web/html/user.html b/web/html/user.html index 2519a17..5ea79b3 100644 --- a/web/html/user.html +++ b/web/html/user.html @@ -109,6 +109,13 @@ Utilisateurs + + diff --git a/web/html/users.html b/web/html/users.html index 1704286..1b3b5b9 100644 --- a/web/html/users.html +++ b/web/html/users.html @@ -112,9 +112,12 @@ Utilisateurs - - - + From 5f4b231e39dc11bf23e6e234c5f897c36a8dbfc1 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Fri, 3 Nov 2023 22:42:06 +0100 Subject: [PATCH 02/23] page html events --- web/html/addevent.html | 236 ++++++++++++++++++++++++++ web/html/event.html | 368 +++++++++++++++++++++++++++++++++++++++++ web/html/events.html | 213 ++++++++++++++++++++++++ 3 files changed, 817 insertions(+) create mode 100644 web/html/addevent.html create mode 100644 web/html/event.html create mode 100644 web/html/events.html diff --git a/web/html/addevent.html b/web/html/addevent.html new file mode 100644 index 0000000..6e99306 --- /dev/null +++ b/web/html/addevent.html @@ -0,0 +1,236 @@ + + + + + + + + + Dashboard Template · Bootstrap v5.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + +
+

Évènement

+
+ +
+ Pseudo + +
+ +
+ Mot de passe + +
+ +
+ Nom + +
+ +
+ Prenom + +
+ +
+ Email + +
+ +
+ Date de naissance + +
+ + + +
+ + +
+ + +
+ + +
+ + + +
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/web/html/event.html b/web/html/event.html new file mode 100644 index 0000000..48e0a72 --- /dev/null +++ b/web/html/event.html @@ -0,0 +1,368 @@ + + + + + + + + + Dashboard Template · Bootstrap v5.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+

Évènement

+
+ +
+ ID + +
+ +
+ Pseudo + +
+ +
+ Mot de passe + +
+ +
+ Nom + +
+ +
+ Prenom + +
+ +
+ Email + +
+ + +
+ + +
+ + +
+ Date de naissance + +
+ +
+ Dernière connexion + +
+ +
+ Date de création + +
+ +
+ Date de mise à jour + +
+ +
+ Date de suppression + +
+ +
+ + +
+
+ + + + + +
+ + + + + + + + + + +
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/web/html/events.html b/web/html/events.html new file mode 100644 index 0000000..a40c95a --- /dev/null +++ b/web/html/events.html @@ -0,0 +1,213 @@ + + + + + + + + + Dashboard Template · Bootstrap v5.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+
+

Évènements

+
+
+ +
+
+
+ + + +

Liste d'évènement

+
+ +
+
+ + +
+
+ + +
+
+
+ + + + +


+ + + + + + + + + + + + + + + + + + + + + + + + +
IDUsernameMailRôleStatut
+
+ +
+
+
+ + + + + + + + + + \ No newline at end of file From 5a7283b92f9f91a972b52e2af1895d1033d8fbce Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Sat, 4 Nov 2023 20:59:06 +0100 Subject: [PATCH 03/23] add disabled_at --- web/html/event.html | 42 ++++++++++++++---------------------------- web/html/user.html | 5 +++++ web/js/user.js | 3 ++- 3 files changed, 21 insertions(+), 29 deletions(-) diff --git a/web/html/event.html b/web/html/event.html index 48e0a72..c674838 100644 --- a/web/html/event.html +++ b/web/html/event.html @@ -186,46 +186,27 @@ -
- Pseudo - -
- -
- Mot de passe - -
-
Nom
- Prenom - + Lieu +
- Email - + Date de début + +
+ +
+ Date de fin +
-
- - -
- - -
- Date de naissance - -
-
Dernière connexion @@ -241,6 +222,11 @@
+
+ Date de désactivation + +
+
Date de suppression diff --git a/web/html/user.html b/web/html/user.html index 5ea79b3..2273ae7 100644 --- a/web/html/user.html +++ b/web/html/user.html @@ -241,6 +241,11 @@
+
+ Date de désactivation + +
+
Date de suppression diff --git a/web/js/user.js b/web/js/user.js index c80838e..80c3321 100644 --- a/web/js/user.js +++ b/web/js/user.js @@ -7,7 +7,7 @@ if(id.length > 0){ instance.get("users/"+id, {withCredentials: true}) .then(function(response){ var listValue = [ "id", "username", "name", "firstName", "email", "birth"]; - var listTime = ["connected_at", "created_at", "updated_at", "deleted_at"]; + var listTime = ["connected_at", "created_at", "updated_at", "deleted_at", "disabled_at"]; for (var i=0; i 0){ "created_at": "", "updated_at": "", "deleted_at": "", + "disabled_at":"", "connected_at": "" } From 4ed38c4940ea2fd1ff3cc5e5bc325439a0908cae Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Sat, 4 Nov 2023 22:42:05 +0100 Subject: [PATCH 04/23] add pages select --- web/html/users.html | 35 ++++++++++++++++++++++++--------- web/js/library.js | 47 +++++++++++++++++++++++++-------------------- web/js/users.js | 20 +++++++++---------- 3 files changed, 62 insertions(+), 40 deletions(-) diff --git a/web/html/users.html b/web/html/users.html index 1b3b5b9..eb12335 100644 --- a/web/html/users.html +++ b/web/html/users.html @@ -141,7 +141,7 @@
- +
- +
-
-
- - - - -


+
+ + +
+
+

+
+
+ +
+
+ +
+
+ +
+
+


diff --git a/web/js/library.js b/web/js/library.js index 4fd381c..8db4cd5 100644 --- a/web/js/library.js +++ b/web/js/library.js @@ -21,34 +21,39 @@ function checkToken(){ } -function buildParam(e, id){ +function buildParam(typeInput){ var search = document.getElementById("searchUser").value; var param = ""; - var listParam = ["page", "nbPages"]; - if(id.length > 0){ - var select = document.getElementById(id); - var getId = select.options[select.selectedIndex].value; - if(id == "inputRoles"){ - var status = e.target.value; - if(status != "-2"){ - param = param + "status="+status+"&"; - } - if(getId != "All"){ - param = param + "roles="+getId; + var listParam = ["skip"]; + if(typeInput.length > 0){ + listId =["inputRoles", "inputStatus", "inputPages"] + for (var i=0; i 0){ diff --git a/web/js/users.js b/web/js/users.js index 50302e3..69947ca 100644 --- a/web/js/users.js +++ b/web/js/users.js @@ -12,7 +12,7 @@ for(var i=0; i Date: Sat, 4 Nov 2023 22:52:47 +0100 Subject: [PATCH 05/23] add variable by URL --- web/js/users.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/web/js/users.js b/web/js/users.js index 69947ca..48081e1 100644 --- a/web/js/users.js +++ b/web/js/users.js @@ -1,5 +1,7 @@ checkToken(); signOut(); +pathURL = document.location.pathname.split("/")[document.location.pathname.split("/").length-1].split(".")[0] + var param = {} param["limit"] = 20; @@ -28,7 +30,7 @@ for (var i=0; i Date: Sat, 4 Nov 2023 22:59:07 +0100 Subject: [PATCH 06/23] remove select and add select page for page events --- web/html/events.html | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/web/html/events.html b/web/html/events.html index a40c95a..f247b20 100644 --- a/web/html/events.html +++ b/web/html/events.html @@ -139,15 +139,6 @@

Liste d'évènement

-
-
- - -
+
+ + +

From ec677a30aba03a12cca406f69c23b6bc31f59d6d Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Sat, 4 Nov 2023 23:09:12 +0100 Subject: [PATCH 07/23] change name script lists --- web/html/events.html | 2 +- web/html/users.html | 2 +- web/js/{users.js => lists.js} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename web/js/{users.js => lists.js} (100%) diff --git a/web/html/events.html b/web/html/events.html index f247b20..c19e7e3 100644 --- a/web/html/events.html +++ b/web/html/events.html @@ -210,5 +210,5 @@ - + \ No newline at end of file diff --git a/web/html/users.html b/web/html/users.html index eb12335..73f92f5 100644 --- a/web/html/users.html +++ b/web/html/users.html @@ -226,5 +226,5 @@ - + \ No newline at end of file diff --git a/web/js/users.js b/web/js/lists.js similarity index 100% rename from web/js/users.js rename to web/js/lists.js From 6fdfc80880bbdd0f70dcc8c4d4c772d6ce70c502 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Sat, 4 Nov 2023 23:13:41 +0100 Subject: [PATCH 08/23] variable for item --- web/html/user.html | 2 +- web/js/{user.js => item.js} | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) rename web/js/{user.js => item.js} (92%) diff --git a/web/html/user.html b/web/html/user.html index 2273ae7..34b612f 100644 --- a/web/html/user.html +++ b/web/html/user.html @@ -369,5 +369,5 @@ - + \ No newline at end of file diff --git a/web/js/user.js b/web/js/item.js similarity index 92% rename from web/js/user.js rename to web/js/item.js index 80c3321..e6a89c2 100644 --- a/web/js/user.js +++ b/web/js/item.js @@ -1,10 +1,12 @@ checkToken(); signOut(); closeButton(); +pathURL = document.location.pathname.split("/")[document.location.pathname.split("/").length-1].split(".")[0] + var id = getQuery("id"); if(id.length > 0){ - instance.get("users/"+id, {withCredentials: true}) + instance.get(pathURL + "s/"+id, {withCredentials: true}) .then(function(response){ var listValue = [ "id", "username", "name", "firstName", "email", "birth"]; var listTime = ["connected_at", "created_at", "updated_at", "deleted_at", "disabled_at"]; @@ -64,15 +66,15 @@ if(id.length > 0){ switch(e.currentTarget.id){ case "disableUserButton": httpMethod = "delete"; - httpUrl = "users/"+idInput; + httpUrl = pathURL + "s/"+idInput; break; case "removeUserButton": httpMethod = "delete"; - httpUrl = "users/"+idInput+"?remove=true"; + httpUrl = pathURL + "s/"+idInput+"?remove=true"; break; default: httpMethod = "patch"; - httpUrl = "users/"+idInput; + httpUrl = pathURL + "s/"+idInput; break; } instance({ @@ -82,7 +84,7 @@ if(id.length > 0){ }) .then(function(response){ if(response.status == 200){ - location.href="/html/user.html?id="+idInput; + location.href="/html/"+pathURL+".html?id="+idInput; } }) .catch(function(error){ @@ -140,7 +142,7 @@ if(id.length > 0){ } instance({ method : "put", - url:"users/"+document.getElementById("idUpdateInput").value, + url:pathURL+"s/"+document.getElementById("idUpdateInput").value, withCredentials: true, data: dataPut }).then(function(response){ From ed6d7dc4f1857c9ad6208e1b736056372549074e Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Sat, 4 Nov 2023 23:37:04 +0100 Subject: [PATCH 09/23] change name addUser script --- web/html/addevent.html | 2 +- web/html/adduser.html | 2 +- web/html/event.html | 2 +- web/js/{addUser.js => addItem.js} | 12 +++--------- 4 files changed, 6 insertions(+), 12 deletions(-) rename web/js/{addUser.js => addItem.js} (92%) diff --git a/web/html/addevent.html b/web/html/addevent.html index 6e99306..8e9023b 100644 --- a/web/html/addevent.html +++ b/web/html/addevent.html @@ -232,5 +232,5 @@ - + \ No newline at end of file diff --git a/web/html/adduser.html b/web/html/adduser.html index 512e852..94fa60f 100644 --- a/web/html/adduser.html +++ b/web/html/adduser.html @@ -232,5 +232,5 @@ - + \ No newline at end of file diff --git a/web/html/event.html b/web/html/event.html index c674838..433d074 100644 --- a/web/html/event.html +++ b/web/html/event.html @@ -350,5 +350,5 @@ - + \ No newline at end of file diff --git a/web/js/addUser.js b/web/js/addItem.js similarity index 92% rename from web/js/addUser.js rename to web/js/addItem.js index ca19c5a..ce6641d 100644 --- a/web/js/addUser.js +++ b/web/js/addItem.js @@ -1,6 +1,7 @@ checkToken(); signOut(); closeButton(); +pathURL = document.location.pathname.split("/")[document.location.pathname.split("/").length-1].split(".")[0].replace("add","") document.getElementById("addUser").addEventListener("click", function(){ @@ -25,25 +26,18 @@ document.getElementById("addUser").addEventListener("click", function(){ } dataPut = { - - "id": "", "username": document.getElementById("usernameUpdateInput").value, "email": document.getElementById("emailUpdateInput").value, "name": document.getElementById("nameUpdateInput").value, "firstName": document.getElementById("firstNameUpdateInput").value, "birth": document.getElementById("birthUpdateInput").value, - "status": 1, "password": document.getElementById("passwordUpdateInput").value, - "roles": selector["roles"], - "created_at": "", - "updated_at": "", - "deleted_at": "", - "connected_at": "" + "roles": selector["roles"] } instance({ method : "put", - url:"users", + url:pathURL+"s", withCredentials: true, data: dataPut }).then(function(response){ From 48c7e38c872d8c6a8c14c76f65e7dbd09258563c Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Tue, 7 Nov 2023 21:09:45 +0100 Subject: [PATCH 10/23] add name --- web/html/events.html | 8 +++++--- web/js/addItem.js | 15 +++++++-------- web/js/library.js | 8 +++++--- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/web/html/events.html b/web/html/events.html index c19e7e3..639d999 100644 --- a/web/html/events.html +++ b/web/html/events.html @@ -171,9 +171,10 @@
- - - + + + + @@ -185,6 +186,7 @@ + diff --git a/web/js/addItem.js b/web/js/addItem.js index ce6641d..519548b 100644 --- a/web/js/addItem.js +++ b/web/js/addItem.js @@ -26,14 +26,13 @@ document.getElementById("addUser").addEventListener("click", function(){ } dataPut = { - "username": document.getElementById("usernameUpdateInput").value, - "email": document.getElementById("emailUpdateInput").value, - "name": document.getElementById("nameUpdateInput").value, - "firstName": document.getElementById("firstNameUpdateInput").value, - "birth": document.getElementById("birthUpdateInput").value, - "password": document.getElementById("passwordUpdateInput").value, - "roles": selector["roles"] - + "username": document.getElementById("usernameUpdateInput").value, + "email": document.getElementById("emailUpdateInput").value, + "name": document.getElementById("nameUpdateInput").value, + "firstName": document.getElementById("firstNameUpdateInput").value, + "birth": document.getElementById("birthUpdateInput").value, + "password": document.getElementById("passwordUpdateInput").value, + "roles": selector["roles"] } instance({ method : "put", diff --git a/web/js/library.js b/web/js/library.js index 8db4cd5..edde26b 100644 --- a/web/js/library.js +++ b/web/js/library.js @@ -59,11 +59,13 @@ function buildParam(typeInput){ if(search.length > 0){ if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(search)){ param = param + "email="+search+"&"; - } else { + } else if (/^[a-fA-F0-9]{24}$/.test(search)){ param = param + "id="+search+"&"; - } + } else { + param = param + "name="+search+"&"; + } } else { - listParam.push("email"); listParam.push("id"); + listParam.push("email"); listParam.push("id"); listParam.push("name"); } for (var i=0; i Date: Thu, 9 Nov 2023 21:17:45 +0100 Subject: [PATCH 11/23] add last id --- web/js/lists.js | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/web/js/lists.js b/web/js/lists.js index 48081e1..0773f35 100644 --- a/web/js/lists.js +++ b/web/js/lists.js @@ -152,9 +152,19 @@ instance.get(pathURL, {withCredentials: true, params:param}).then(function(respo td = trAll[i].querySelectorAll("td"); td[0].querySelector("input").setAttribute("userid", listData[i].id) td[1].textContent = listData[i].id; - td[2].textContent = listData[i].username; - td[3].textContent = listData[i].email; - td[4].textContent = listData[i].roles; + if(pathURL == "users"){ + td[2].textContent = listData[i].username; + td[3].textContent = listData[i].email; + td[4].textContent = listData[i].roles; + last_id = 5; + } + if(pathURL == "events"){ + td[2].textContent = listData[i].name; + td[3].textContent = listData[i].place; + td[4].textContent = listData[i].start_date; + td[5].textContent = listData[i].start_date; + last_id = 6; + } var classTd = ""; switch(listData[i].status){ case 1: @@ -173,12 +183,12 @@ instance.get(pathURL, {withCredentials: true, params:param}).then(function(respo classTd = ".unknownStatus" break; } - td[5].querySelector(".activeStatus").classList.add("hidden"); - td[5].querySelector(classTd).classList.remove("hidden"); + td[last_id].querySelector(".activeStatus").classList.add("hidden"); + td[last_id].querySelector(classTd).classList.remove("hidden"); - td[6].querySelector("button").setAttribute("userid", listData[i].id) + td[last_id + 1].querySelector("button").setAttribute("userid", listData[i].id) - td[6].querySelector("button").addEventListener("click", function(e){ + td[last_id + 1].querySelector("button").addEventListener("click", function(e){ var id = e.currentTarget.getAttribute("userid"); location.href="/html/"+pathURL.slice(0, -1)+".html?id="+id; }); From 83321404ab55d50fb0de5721bff1a9554a1c2637 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Thu, 9 Nov 2023 21:22:20 +0100 Subject: [PATCH 12/23] fix list events --- web/html/events.html | 2 +- web/js/lists.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/web/html/events.html b/web/html/events.html index 639d999..f0797eb 100644 --- a/web/html/events.html +++ b/web/html/events.html @@ -129,7 +129,7 @@

Évènements

- +
diff --git a/web/js/lists.js b/web/js/lists.js index 0773f35..a6287f3 100644 --- a/web/js/lists.js +++ b/web/js/lists.js @@ -216,8 +216,13 @@ document.getElementById("searchUser").addEventListener("keydown", function(ev){ } }); +if (pathURL=="users"){ + listInput = ["Status", "Roles", "Pages" ] +} +if (pathURL=="events"){ + listInput = ["Status", "Pages" ] +} -listInput = ["Status", "Roles", "Pages" ] for (var i=0; i Date: Fri, 10 Nov 2023 23:50:41 +0100 Subject: [PATCH 13/23] update page addevents --- web/html/addevent.html | 36 ++++++++---------------------------- web/js/lists.js | 6 ++---- 2 files changed, 10 insertions(+), 32 deletions(-) diff --git a/web/html/addevent.html b/web/html/addevent.html index 8e9023b..4bcb367 100644 --- a/web/html/addevent.html +++ b/web/html/addevent.html @@ -173,49 +173,29 @@

Évènement

-
- Pseudo - -
- -
- Mot de passe - -
-
Nom - +
- Prenom - + Lieu +
- Email - + Date de début de l'évènement +
- Date de naissance - -
- - - -
- - + Date de fin de l'évènement +
- +
diff --git a/web/js/lists.js b/web/js/lists.js index a6287f3..728b015 100644 --- a/web/js/lists.js +++ b/web/js/lists.js @@ -216,11 +216,9 @@ document.getElementById("searchUser").addEventListener("keydown", function(ev){ } }); +listInput = ["Status", "Pages" ] if (pathURL=="users"){ - listInput = ["Status", "Roles", "Pages" ] -} -if (pathURL=="events"){ - listInput = ["Status", "Pages" ] + listInput.append("Roles") } for (var i=0; i Date: Sat, 11 Nov 2023 19:16:05 +0100 Subject: [PATCH 14/23] geoencoding searhc --- web/html/addevent.html | 11 +++++------ web/js/geosearch.js | 7 +++++++ 2 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 web/js/geosearch.js diff --git a/web/html/addevent.html b/web/html/addevent.html index 4bcb367..e82d328 100644 --- a/web/html/addevent.html +++ b/web/html/addevent.html @@ -9,11 +9,10 @@ Dashboard Template · Bootstrap v5.2 - - - + + @@ -24,7 +23,9 @@ + +
IDUsernameMailRôleNomLieuDate de débutDate de fin Statut