feature - edit profile to its maximum and beyond !
This commit is contained in:
		
							
								
								
									
										2
									
								
								dist/lib/sib-core
									
									
									
									
										vendored
									
									
								
							
							
								
								
								
								
								
							
						
						
									
										2
									
								
								dist/lib/sib-core
									
									
									
									
										vendored
									
									
								
							 Submodule dist/lib/sib-core updated: 444d258357...60be3fcb3d
									
								
							| @ -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> | ||||
|  | ||||
		Reference in New Issue
	
	Block a user