feature - edit profile to its maximum and beyond !

This commit is contained in:
Alexandre Bourlier 2018-07-09 23:06:56 +02:00
parent d03ea92adf
commit f29e3c829d
2 changed files with 37 additions and 6 deletions

2
dist/lib/sib-core vendored

@ -1 +1 @@
Subproject commit 444d258357cc525300c291e45f7be7f920f972e1
Subproject commit 60be3fcb3d3f54f7fa3f760cf6cdbb2aeac4277d

View File

@ -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>