added input for custom images

This commit is contained in:
Vito Albano
2016-11-08 16:55:23 +00:00
parent 5dd82dca25
commit 3c3306962d
2 changed files with 15 additions and 5 deletions

View File

@@ -20,7 +20,7 @@
<div class="demo-card-wide mdl-card">
<div class="card-title__option mdl-card__title"
id="ecm-background-image"
[style.background-image]="'url(' + baseComponentPath + '/../img/orangeBanner.png)'">
[style.background-image]="'url(' + ( ecmBackgroundImage || baseComponentPath + '/../img/orangeBanner.png')+')'">
<img class="profile-picture"
id="ecm-user-detail-image"
alt="ecm-profile-image"
@@ -37,7 +37,8 @@
<span id="ecm-email" class="mdl-list__item-sub-title">{{ecmUser.email}}</span>
</span>
<span id="ecm-job-title" class="mdl-list__item-secondary-content custom-role-style">
<span class="role-label-user">{{ 'USER_PROFILE.LABELS.ECM.JOB_TITLE' | translate }}</span>
<span
class="role-label-user">{{ 'USER_PROFILE.LABELS.ECM.JOB_TITLE' | translate }}</span>
{{ecmUser.jobTitle?ecmUser.jobTitle:'N/A'}}
</span>
</li>
@@ -50,7 +51,7 @@
<div class="demo-card-wide mdl-card">
<div class="card-title__option mdl-card__title"
id="bpm-background-image"
[style.background-image]="'url(' + baseComponentPath + '/../img/blueBanner.png)'">
[style.background-image]="'url(' + (bpmBackgroundImage || baseComponentPath + '/../img/blueBanner.png')+')'">
<img class="profile-picture"
id="bpm-user-detail-image"
alt="bpm-profile-image"

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, Input } from '@angular/core';
import { EcmUserModel } from './../models/ecm-user.model';
import { BpmUserModel } from './../models/bpm-user.model';
import { EcmUserService } from './../services/ecm-user.service';
@@ -31,6 +31,15 @@ import { AlfrescoSettingsService, AlfrescoTranslationService } from 'ng2-alfresc
export class UserInfoComponent implements OnInit {
@Input()
ecmBackgroundImage: string;
@Input()
bpmBackgroundImage: string;
@Input()
fallBackThumbnailImage: string;
private baseComponentPath = module.id.replace('components/user-info.component.js', '');
ecmUser: EcmUserModel;
@@ -72,7 +81,7 @@ export class UserInfoComponent implements OnInit {
onImageLoadingError(event) {
if (event) {
let element = <any> event.target;
element.src = this.anonymousImageUrl;
element.src = this.fallBackThumbnailImage || this.anonymousImageUrl;
}
}