Skip to content
Snippets Groups Projects
Commit f29e3c82 authored by Alexandre Bourlier's avatar Alexandre Bourlier
Browse files

feature - edit profile to its maximum and beyond !

parent d03ea92a
No related branches found
No related tags found
No related merge requests found
sib-core @ 60be3fcb
Subproject commit 444d258357cc525300c291e45f7be7f920f972e1
Subproject commit 60be3fcb3d3f54f7fa3f760cf6cdbb2aeac4277d
......@@ -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 `<div id="${firstname}-${lastname}">${firstname} ${lastname}</div>
<div id="${email}">${email}</div>`;
}
}
customElements.define('hdapp-userinfo', HDAppUserInfo);
</script>
<div id="member-edit-profile" style="display: none">
<label for="avatar-input">
<img id="avatar-preview" src="http://cdn.local/hdapp/members/alexandre-bourlier.jpg" style="width: 100%;"/>
</label>
<input type="file" accept="image/*" id="avatar-input" name="avatar" value="http://cdn.hd-app.local/members/alexandre-bourlier.jpg" />
<!--<label for="avatar-input">-->
<!--<img id="avatar-preview" src="http://cdn.local/hdapp/members/alexandre-bourlier.jpg" style="width: 100%;"/>-->
<!--</label>-->
<!--<input type="file" accept="image/*" id="avatar-input" name="avatar" value="http://cdn.hd-app.local/members/alexandre-bourlier.jpg" />-->
<sib-form
class="edit-form"
data-fields="user, avatar, bio, cell, jabberID, number, pseudo, skills, website"
widget-user="hdapp-usereditinfo"
range-cell="<?php echo $sdn; ?>/cells/"
widget-skills="sib-form-multiple-dropdown"
range-skills="<?php echo $sdn; ?>/skills/"
bind-resources
></sib-form>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment