aboutsummaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorMrArmonius <mrarmonius@gmail.com>2021-07-30 00:04:17 +0200
committerAlex Auvolat <alex@adnab.me>2021-08-16 12:54:08 +0200
commita2a484daba1ef42d82f596a989caf203ee9a370f (patch)
treea3ec45738fa59448dd99d6dd5e69172f18043e90 /static
parent0ca6a159b215967a6d13b9bad5c008983e032c3f (diff)
downloadguichet-a2a484daba1ef42d82f596a989caf203ee9a370f.tar.gz
guichet-a2a484daba1ef42d82f596a989caf203ee9a370f.zip
Add profile image front-end and back-end
Correct when empty result The image showed when the result was empty. Now if the `dn == ""` then we write in the column image just `""`
Diffstat (limited to 'static')
-rw-r--r--static/image/34431.pngbin0 -> 782061 bytes
-rw-r--r--static/javascript/minio.js5
-rw-r--r--static/javascript/search.js14
3 files changed, 15 insertions, 4 deletions
diff --git a/static/image/34431.png b/static/image/34431.png
new file mode 100644
index 0000000..2aba26b
--- /dev/null
+++ b/static/image/34431.png
Binary files differ
diff --git a/static/javascript/minio.js b/static/javascript/minio.js
new file mode 100644
index 0000000..cea2a18
--- /dev/null
+++ b/static/javascript/minio.js
@@ -0,0 +1,5 @@
+document.querySelector('.custom-file-input').addEventListener('change',function(e){
+ var fileName = document.getElementById("image").files[0].name;
+ var nextSibling = e.target.nextElementSibling
+ nextSibling.innerText = fileName
+ })
diff --git a/static/javascript/search.js b/static/javascript/search.js
index 6d33fe6..212ed15 100644
--- a/static/javascript/search.js
+++ b/static/javascript/search.js
@@ -21,12 +21,18 @@ function searchDirectory() {
for (let i =0; i < Object.keys(jsonResponse.search).length; i++) {
var row = table.insertRow(0);
- var identifiant = row.insertCell(0);
- var name = row.insertCell(1);
- var email = row.insertCell(2);
- var description = row.insertCell(3);
+ var urlName = row.insertCell(0);
+ var identifiant = row.insertCell(1);
+ var name = row.insertCell(2);
+ var email = row.insertCell(3);
+ var description = row.insertCell(4);
description.setAttribute("style", "word-break: break-all;");
+ if (jsonResponse.search[i].dn.localeCompare("")!=0) {
+ urlName.innerHTML = `<object data="/image/${jsonResponse.search[i].dn}/little" class=".img-thumbnail"><image src="/image/unknown_profile/little" class=".img-thumbnail"></object>`
+ }else {
+ urlName.innerHTML=""
+ }
identifiant.innerHTML = `<a href="/admin/ldap/${jsonResponse.search[i].dn}">${jsonResponse.search[i].identifiant}</a>`
name.innerHTML = jsonResponse.search[i].name
email.innerHTML = jsonResponse.search[i].email