2018-11-08 17:38:44 +01:00
|
|
|
<os-head-bar [mainButton]="isAllowed('manage')" mainButtonIcon="edit" [nav]="false" [editMode]="editUser"
|
|
|
|
(mainEvent)="setEditMode(!editUser)" (saveEvent)="saveUser()">
|
2018-10-05 16:34:08 +02:00
|
|
|
<!-- Title -->
|
|
|
|
<div class="title-slot">
|
2018-11-08 17:38:44 +01:00
|
|
|
<h2 *ngIf="editUser">
|
|
|
|
{{ personalInfoForm.get('title').value }}
|
|
|
|
{{ personalInfoForm.get('first_name').value }}
|
|
|
|
{{ personalInfoForm.get('last_name').value }}
|
2018-10-05 16:34:08 +02:00
|
|
|
</h2>
|
2018-09-18 18:27:14 +02:00
|
|
|
|
2018-11-08 17:38:44 +01:00
|
|
|
<h2 *ngIf="!editUser">
|
|
|
|
{{ user.full_name }}
|
2018-10-05 16:34:08 +02:00
|
|
|
</h2>
|
2018-09-18 18:27:14 +02:00
|
|
|
</div>
|
|
|
|
|
2018-10-05 16:34:08 +02:00
|
|
|
<!-- Menu -->
|
|
|
|
<div class="menu-slot">
|
|
|
|
<button type="button" mat-icon-button [matMenuTriggerFor]="userExtraMenu">
|
2018-10-11 14:03:44 +02:00
|
|
|
<mat-icon>more_vert</mat-icon>
|
2018-09-18 18:27:14 +02:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<mat-menu #userExtraMenu="matMenu">
|
2018-11-08 17:38:44 +01:00
|
|
|
<button mat-menu-item class="red-warning-text" (click)="deleteUserButton()">
|
2018-10-05 16:34:08 +02:00
|
|
|
<mat-icon>delete</mat-icon>
|
|
|
|
<span translate>Delete</span>
|
|
|
|
</button>
|
2018-09-18 18:27:14 +02:00
|
|
|
</mat-menu>
|
2018-10-05 16:34:08 +02:00
|
|
|
</os-head-bar>
|
2018-09-18 18:27:14 +02:00
|
|
|
|
|
|
|
<mat-card class="os-card" *osPerms="'users.can_see_name'">
|
2018-11-21 09:14:19 +01:00
|
|
|
<form [ngClass]="{'mat-form-field-enabled': editUser}" [formGroup]="personalInfoForm" (ngSubmit)="saveUser()" *ngIf="user" (keydown)="onKeyDown($event)">
|
2018-09-18 18:27:14 +02:00
|
|
|
<!-- <h3 translate>Personal Data</h3> -->
|
2018-11-08 17:38:44 +01:00
|
|
|
<div *ngIf="isAllowed('seeName')">
|
2018-09-18 18:27:14 +02:00
|
|
|
<!-- Title -->
|
2018-11-08 17:38:44 +01:00
|
|
|
<mat-form-field class="form30 distance force-min-with" *ngIf="user.title || editUser && isAllowed('manage')">
|
|
|
|
<input type="text" matInput osAutofocus placeholder="{{ 'Title' | translate }}" formControlName="title"
|
|
|
|
[value]="user.title">
|
2018-09-18 18:27:14 +02:00
|
|
|
</mat-form-field>
|
|
|
|
|
|
|
|
<!-- First name -->
|
2018-11-08 17:38:44 +01:00
|
|
|
<mat-form-field class="form30 distance force-min-with" *ngIf="user.first_name || editUser && isAllowed('manage')">
|
|
|
|
<input type="text" matInput placeholder="{{ 'Given name' | translate }}" formControlName="first_name"
|
|
|
|
[value]="user.first_name">
|
2018-09-18 18:27:14 +02:00
|
|
|
</mat-form-field>
|
|
|
|
|
|
|
|
<!-- Last name -->
|
2018-11-08 17:38:44 +01:00
|
|
|
<mat-form-field class="form30 force-min-with" *ngIf="user.last_name || editUser && isAllowed('manage')">
|
|
|
|
<input type="text" matInput placeholder="{{ 'Surname' | translate }}" formControlName="last_name"
|
|
|
|
[value]="user.last_name">
|
2018-09-18 18:27:14 +02:00
|
|
|
</mat-form-field>
|
|
|
|
</div>
|
|
|
|
|
2018-11-08 17:38:44 +01:00
|
|
|
<div *ngIf="isAllowed('seePersonal')">
|
2018-09-18 18:27:14 +02:00
|
|
|
<!-- E-Mail -->
|
2018-11-08 17:38:44 +01:00
|
|
|
<mat-form-field class="form100" *ngIf="user.email || editUser">
|
|
|
|
<input type="email" matInput placeholder="{{ 'Email' | translate }}" name="email" formControlName="email"
|
|
|
|
[value]="user.email">
|
|
|
|
<mat-error *ngIf="personalInfoForm.get('email').hasError('email')" translate>
|
2018-09-18 18:27:14 +02:00
|
|
|
Please enter a valid email address
|
|
|
|
</mat-error>
|
|
|
|
</mat-form-field>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
2018-10-16 08:08:59 +02:00
|
|
|
<!-- Strucuture Level -->
|
2018-11-08 17:38:44 +01:00
|
|
|
<mat-form-field class="form70 distance" *ngIf="user.structure_level || editUser && isAllowed('manage')">
|
|
|
|
<input type="text" matInput placeholder="{{ 'Structure level' | translate }}" formControlName="structure_level"
|
|
|
|
[value]="user.structure_level">
|
2018-09-18 18:27:14 +02:00
|
|
|
</mat-form-field>
|
|
|
|
|
|
|
|
<!-- Partizipant Number -->
|
2018-11-08 17:38:44 +01:00
|
|
|
<mat-form-field class="form20 force-min-with" *ngIf="user.participant_number || editUser && isAllowed('manage')">
|
|
|
|
<input type="text" matInput placeholder="{{ 'Participant number' | translate }}" formControlName="number"
|
|
|
|
[value]="user.participant_number">
|
2018-09-18 18:27:14 +02:00
|
|
|
</mat-form-field>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<!-- Groups -->
|
2018-11-08 17:38:44 +01:00
|
|
|
<mat-form-field class="form100" *ngIf="user.groups && user.groups.length > 0 || editUser">
|
|
|
|
<mat-select placeholder="{{ 'Groups' | translate }}" formControlName="groups_id" multiple>
|
|
|
|
<mat-option *ngFor="let group of groups" [value]="group.id">{{ group }}</mat-option>
|
2018-09-18 18:27:14 +02:00
|
|
|
</mat-select>
|
|
|
|
</mat-form-field>
|
|
|
|
</div>
|
|
|
|
|
2018-11-08 17:38:44 +01:00
|
|
|
<div *ngIf="isAllowed('manage')">
|
2018-09-18 18:27:14 +02:00
|
|
|
<!-- Initial Password -->
|
2018-11-08 17:38:44 +01:00
|
|
|
<mat-form-field class="form100">
|
|
|
|
<input matInput placeholder="{{ 'Initial password' | translate }}" formControlName="default_password"
|
|
|
|
[value]="user.default_password">
|
2018-09-18 18:27:14 +02:00
|
|
|
<mat-hint align="end">Generate</mat-hint>
|
2018-11-08 17:38:44 +01:00
|
|
|
<button type="button" mat-button matSuffix mat-icon-button [disabled]="!newUser"
|
|
|
|
(click)="generatePassword()">
|
2018-10-11 14:03:44 +02:00
|
|
|
<mat-icon>sync_problem</mat-icon>
|
2018-09-18 18:27:14 +02:00
|
|
|
</button>
|
|
|
|
</mat-form-field>
|
|
|
|
</div>
|
|
|
|
|
2018-11-20 13:31:56 +01:00
|
|
|
<!-- About me -->
|
2018-11-08 17:38:44 +01:00
|
|
|
<div *ngIf="isAllowed('seePersonal')">
|
2018-11-20 13:31:56 +01:00
|
|
|
<!-- The HTML Editor -->
|
|
|
|
<h4 translate *ngIf="user.about_me || editUser">About me</h4>
|
|
|
|
<editor
|
|
|
|
formControlName='about_me'
|
|
|
|
[init]="tinyMceSettings"
|
|
|
|
*ngIf="editUser"
|
|
|
|
></editor>
|
|
|
|
<div *ngIf="user.about_me && !editUser" [innerHTML]="user.about_me"></div>
|
2018-09-18 18:27:14 +02:00
|
|
|
</div>
|
|
|
|
|
2018-11-08 17:38:44 +01:00
|
|
|
<div *ngIf="isAllowed('seePersonal')">
|
2018-09-18 18:27:14 +02:00
|
|
|
<!-- username -->
|
2018-11-08 17:38:44 +01:00
|
|
|
<mat-form-field class="form100" *ngIf="user.username || editUser">
|
|
|
|
<input type="text" matInput placeholder="{{ 'Username' | translate }}" formControlName="username"
|
|
|
|
[value]="user.username">
|
2018-09-18 18:27:14 +02:00
|
|
|
</mat-form-field>
|
|
|
|
</div>
|
|
|
|
|
2018-11-08 17:38:44 +01:00
|
|
|
<div *ngIf="isAllowed('seeExtra')">
|
2018-09-18 18:27:14 +02:00
|
|
|
<!-- Comment -->
|
2018-11-08 17:38:44 +01:00
|
|
|
<mat-form-field class="form100" *ngIf="user.comment || editUser">
|
|
|
|
<input matInput placeholder="{{ 'Comment' | translate }}" formControlName="comment" [value]="user.comment">
|
2018-09-18 18:27:14 +02:00
|
|
|
<mat-hint translate>Only for internal notes.</mat-hint>
|
|
|
|
</mat-form-field>
|
|
|
|
</div>
|
|
|
|
|
2018-11-08 17:38:44 +01:00
|
|
|
<div *ngIf="isAllowed('seeExtra')">
|
2018-09-18 18:27:14 +02:00
|
|
|
<!-- Present? -->
|
2018-11-08 17:38:44 +01:00
|
|
|
<mat-checkbox formControlName="is_present"
|
|
|
|
matTooltip="{{ 'Designates whether this user is in the room.' | translate }}" [value]="user.is_present">
|
2018-11-06 16:57:36 +01:00
|
|
|
<span translate>Is present</span>
|
2018-09-18 18:27:14 +02:00
|
|
|
</mat-checkbox>
|
2018-11-08 17:38:44 +01:00
|
|
|
|
2018-09-18 18:27:14 +02:00
|
|
|
<!-- Active? -->
|
2018-11-08 17:38:44 +01:00
|
|
|
<mat-checkbox *osPerms="'users.can_see_extra_data'" formControlName="is_active" [value]="user.is_active"
|
|
|
|
matTooltip="{{ 'Designates whether this user should be treated as active. Unselect this instead of deleting the account.' | translate }}">
|
2018-11-06 16:57:36 +01:00
|
|
|
<span translate>Is active</span>
|
2018-09-18 18:27:14 +02:00
|
|
|
</mat-checkbox>
|
2018-11-08 17:38:44 +01:00
|
|
|
|
2018-09-18 18:27:14 +02:00
|
|
|
<!-- Commitee? -->
|
2018-11-08 17:38:44 +01:00
|
|
|
<mat-checkbox formControlName="is_committee" [value]="user.is_committee"
|
|
|
|
matTooltip="{{ 'Designates whether this user should be treated as a committee.' | translate }}">
|
2018-09-18 18:27:14 +02:00
|
|
|
<span translate>Is a committee</span>
|
|
|
|
</mat-checkbox>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</mat-card>
|