98 lines
2.6 KiB
HTML
98 lines
2.6 KiB
HTML
<section class="accounts-page">
|
|
<header class="page-header">
|
|
<div>
|
|
<h1>Accounts</h1>
|
|
<p>
|
|
{{
|
|
isReadOnly
|
|
? 'Personen der eigenen Organisation ansehen.'
|
|
: 'Account-Zugänge verwalten, Rollen setzen und Impersonation starten.'
|
|
}}
|
|
</p>
|
|
</div>
|
|
@if (!isReadOnly) {
|
|
<button
|
|
mat-flat-button
|
|
color="primary"
|
|
type="button"
|
|
matTooltip="Neuen Account anlegen"
|
|
(click)="startCreate()">
|
|
<mat-icon>person_add</mat-icon>
|
|
Neuer Account
|
|
</button>
|
|
}
|
|
</header>
|
|
|
|
<section style="display: flex; gap: 1rem; align-items: center">
|
|
<app-query-param-input
|
|
queryParamKey="search"
|
|
label="Nach Name oder E-Mail suchen"
|
|
style="width: 35%" />
|
|
<app-query-param-selector
|
|
queryParamKey="organization_id"
|
|
[options]="selectorOptions()"
|
|
label="Organisation"
|
|
[allowEmptyValue]="true"
|
|
style="width: 25%" />
|
|
</section>
|
|
<mat-card appearance="outlined">
|
|
<mat-card-content>
|
|
<app-data-table [columns]="accountColumns" [data]="accountPage().items" />
|
|
</mat-card-content>
|
|
</mat-card>
|
|
<app-query-param-paginator [total]="accountPage().total" />
|
|
</section>
|
|
|
|
<ng-template #accountRoleTmp let-row>
|
|
@for (role of row.roles; track role) {
|
|
<span class="role">{{ role | role }}</span>
|
|
}
|
|
</ng-template>
|
|
|
|
<ng-template #accountStatusTmp let-row>
|
|
<span
|
|
class="status"
|
|
[class.status--deleted]="row.deleted"
|
|
[class.status--deactivated]="!row.deleted && !row.activated">
|
|
{{
|
|
(row.deleted ? 'deleted' : row.activated ? 'active' : 'inactive') | status
|
|
}}
|
|
</span>
|
|
</ng-template>
|
|
|
|
<ng-template #accountActionsTmp let-row>
|
|
<div class="row-actions">
|
|
<button
|
|
mat-icon-button
|
|
type="button"
|
|
aria-label="Bearbeiten"
|
|
(click)="startEdit(row)">
|
|
<mat-icon>edit</mat-icon>
|
|
</button>
|
|
<button
|
|
mat-icon-button
|
|
type="button"
|
|
aria-label="Impersonate"
|
|
[disabled]="!canImpersonate(row)"
|
|
(click)="impersonate(row)">
|
|
<mat-icon>switch_account</mat-icon>
|
|
</button>
|
|
<button
|
|
mat-icon-button
|
|
type="button"
|
|
[attr.aria-label]="row.activated ? 'Deaktivieren' : 'Aktivieren'"
|
|
[disabled]="row.is_current || row.deleted"
|
|
(click)="toggleAccountActivation(row)">
|
|
<mat-icon>{{ row.activated ? 'person_off' : 'person_check' }}</mat-icon>
|
|
</button>
|
|
<button
|
|
mat-icon-button
|
|
type="button"
|
|
aria-label="Deaktivieren"
|
|
[disabled]="row.is_current || row.deleted"
|
|
(click)="deleteAccount(row)">
|
|
<mat-icon>delete</mat-icon>
|
|
</button>
|
|
</div>
|
|
</ng-template>
|