2018-01-31 09:14:00 +01:00

65 lines
4.3 KiB
HTML

<ion-header>
<ion-navbar>
<ion-title><core-format-text [text]="title"></core-format-text></ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<ion-refresher [enabled]="userLoaded" (ionRefresh)="refreshUser($event)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="userLoaded">
<ion-list *ngIf="user && !isDeleted">
<ion-item text-center>
<div class="item-avatar-center">
<img *ngIf="user.profileimageurl" class="avatar" [src]="user.profileimageurl" core-external-content alt="{{ 'core.pictureof' | translate:{$a: user.fullname} }}" role="presentation">
<img *ngIf="!user.profileimageurl" class="avatar" src="assets/img/user-avatar.png" alt="{{ 'core.pictureof' | translate:{$a: user.fullname} }}" role="presentation">
<ion-icon name="create" class="core-icon-foreground" *ngIf="canChangeProfilePicture" (click)="changeProfilePicture()"></ion-icon>
</div>
<h2><core-format-text [text]="user.fullname"></core-format-text></h2>
<p><core-format-text *ngIf="user.address" [text]="user.address"></core-format-text></p>
<p *ngIf="user.roles">
<strong>{{ 'core.user.roles' | translate}}</strong>{{'core.labelsep' | translate}}
<core-format-text [text]="user.roles"></core-format-text>
</p>
</ion-item>
<ion-grid ion-item class="core-user-communication-handlers" *ngIf="(communicationHandlers && communicationHandlers.length) || isLoadingHandlers">
<ion-row no-padding align-items-center text-center>
<ion-col align-self-center *ngIf="communicationHandlers && communicationHandlers.length">
<a *ngFor="let comHandler of communicationHandlers" (click)="handlerClicked($event, comHandler)" [ngClass]="['core-user-profile-handler', comHandler.class]" title="{{comHandler.title | translate}}">
<ion-icon [name]="comHandler.icon"></ion-icon>
<p>{{comHandler.title | translate}}</p>
</a>
</ion-col>
<ion-col text-center class="core-loading-handlers" *ngIf="isLoadingHandlers">
<ion-spinner></ion-spinner>
</ion-col>
</ion-row>
</ion-grid>
<a ion-item text-wrap class="core-user-profile-handler" (click)="openUserDetails()" title="{{ 'core.user.details' | translate }}">
<ion-icon name="person" item-start></ion-icon>
<h2>{{ 'core.user.details' | translate }}</h2>
</a>
<ion-item text-center class="core-loading-handlers" *ngIf="isLoadingHandlers">
<ion-spinner></ion-spinner>
</ion-item>
<a *ngFor="let npHandler of newPageHandlers" ion-item text-wrap [ngClass]="['core-user-profile-handler', npHandler.class]" (click)="handlerClicked($event, npHandler)" [hidden]="npHandler.hidden" title="{{ npHandler.title | translate }}">
<ion-icon *ngIf="npHandler.icon" [name]="npHandler.icon" item-start></ion-icon>
<h2>{{ npHandler.title | translate }}</h2>
</a>
<ion-item *ngIf="actionHandlers && actionHandlers.length">
<button *ngFor="let actHandler of actionHandlers" ion-button block outline [ngClass]="['core-user-profile-handler', actHandler.class]" (click)="handlerClicked($event, actHandler)" [hidden]="actHandler.hidden" title="{{ actHandler.title | translate }}">
<ion-icon *ngIf="actHandler.icon" [name]="actHandler.icon" item-start></ion-icon>
{{ actHandler.title | translate }}
<ion-spinner *ngIf="actHandler.spinner" item-end></ion-spinner>
</button>
</ion-item>
</ion-list>
<core-empty-box *ngIf="!user && !isDeleted" icon="person" [message]=" 'core.user.detailsnotavailable' | translate"></core-empty-box>
<core-empty-box *ngIf="isDeleted" icon="person" [message]="'core.userdeleted' | translate"></core-empty-box>
</core-loading>
</ion-content>