From f29e3c829db4d7c2fa30b7de17854255ea9c7dc1 Mon Sep 17 00:00:00 2001 From: Alexandre Bourlier Date: Mon, 9 Jul 2018 23:06:56 +0200 Subject: [PATCH] feature - edit profile to its maximum and beyond ! --- dist/lib/sib-core | 2 +- src/html/member-edit-profile.html | 41 +++++++++++++++++++++++++++---- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/dist/lib/sib-core b/dist/lib/sib-core index 444d258..60be3fc 160000 --- a/dist/lib/sib-core +++ b/dist/lib/sib-core @@ -1 +1 @@ -Subproject commit 444d258357cc525300c291e45f7be7f920f972e1 +Subproject commit 60be3fcb3d3f54f7fa3f760cf6cdbb2aeac4277d diff --git a/src/html/member-edit-profile.html b/src/html/member-edit-profile.html index d9b4f2b..dbd0f85 100644 --- a/src/html/member-edit-profile.html +++ b/src/html/member-edit-profile.html @@ -13,18 +13,49 @@ // } //} //customElements.define("ldp-form-img-upload", LDPFormImgUpload); - //widget-avatar="ldp-form-img-upload" + + + class HDAppUserInfo extends SIBDisplayLookupList { + get parentElement() {return "div"} + getTemplate(value, index) { + var firstname, lastname, email; + + if(typeof value == "object") + if(value.first_name) { + firstname = value.first_name; + lastname = value.last_name; + email = value.email; + } + else { + store.get(value).then(resource => { + this.value.push(resource); + this.render(); + }); + if(Array.isArray(this.value))this.value.splice(this.value.indexOf(value), 1); + else this.value = []; + return ''; + } + return `
${firstname} ${lastname}
+
${email}
`; + } + } + customElements.define('hdapp-userinfo', HDAppUserInfo);