From 819d7bf02f1c7b119468c1353b78a3d3bb7015fe Mon Sep 17 00:00:00 2001 From: MrArmonius Date: Wed, 21 Jul 2021 21:22:29 +0200 Subject: New HTML Directory --- static/javascript/search.js | 16 +++++++++------- templates/directory.html | 33 +++++++++++++++++++++++++++++++++ templates/home.html | 1 + templates/layout.html | 1 + 4 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 templates/directory.html diff --git a/static/javascript/search.js b/static/javascript/search.js index ea1e155..b82b232 100644 --- a/static/javascript/search.js +++ b/static/javascript/search.js @@ -1,8 +1,8 @@ function searchDirectory() { var input = document.getElementById("search").value; - - var xhttp = new XMLHttpRequest(); - xhttp.onreadystatechange = function() { + if(input){ + var xhttp = new XMLHttpRequest(); + xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 201) { // Typical action to be performed when the document is ready: //Response from Request Ajax @@ -26,10 +26,12 @@ function searchDirectory() { } old_table.parentNode.replaceChild(table, old_table) } - }; - xhttp.overrideMimeType("application/json"); - xhttp.open("GET", "/search/".concat(input), true); - xhttp.send(); + }; + xhttp.overrideMimeType("application/json"); + xhttp.open("GET", "/search/".concat(input), true); + xhttp.send(); + } + diff --git a/templates/directory.html b/templates/directory.html new file mode 100644 index 0000000..bdc587f --- /dev/null +++ b/templates/directory.html @@ -0,0 +1,33 @@ +{{define "title"}}Directory |{{end}} + +{{define "body"}} +
+

Directory

+ Menu principal +
+ + + +
+
+

Name:

+
+ +
+
+
+ + + + + + + + + + + +
IdentifiantNom completEmail
+ + +{{end}} \ No newline at end of file diff --git a/templates/home.html b/templates/home.html index 5556ba7..7d8cc99 100644 --- a/templates/home.html +++ b/templates/home.html @@ -16,6 +16,7 @@
Modifier mon profil Modifier mon mot de passe + Annuaire
diff --git a/templates/layout.html b/templates/layout.html index 5f4a315..f59f9fe 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -6,6 +6,7 @@ + {{template "title"}} Guichet -- cgit v1.2.3