2020-11-03 19:25:03 +01:00
|
|
|
<div page-content>
|
|
|
|
<div header>
|
|
|
|
<ng-content></ng-content>
|
|
|
|
<div class="uk-grid uk-flex uk-flex-middle" uk-grid>
|
2021-03-28 13:07:48 +02:00
|
|
|
<div class="uk-width-expand@m uk-width-1-1 uk-flex uk-flex-left@m uk-flex-center">
|
2020-11-03 19:25:03 +01:00
|
|
|
<ul class="uk-subnav uk-subnav-pill">
|
2021-03-28 13:07:48 +02:00
|
|
|
<li [class.uk-active]="showCurrent" (click)="showCurrent = true">
|
2020-11-04 10:09:18 +01:00
|
|
|
<a class="uk-text-capitalize">{{role}}s</a>
|
2020-11-03 19:25:03 +01:00
|
|
|
</li>
|
2021-03-28 13:07:48 +02:00
|
|
|
<li [class.uk-active]="!showCurrent" (click)="showCurrent = false">
|
2020-11-03 19:25:03 +01:00
|
|
|
<a>Pending {{role}}s</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2021-01-21 16:15:53 +01:00
|
|
|
<div [class.uk-invisible]="loadActive || loadPending"
|
2021-03-28 13:07:48 +02:00
|
|
|
class="uk-width-auto@m uk-width-1-1 uk-child-width-auto@m uk-child-width-1-1 uk-grid uk-flex-right@m uk-flex-center" uk-grid>
|
|
|
|
<div *ngIf="showCurrent" search-input [control]="filterForm.get('active')" [showSearch]="false" [placeholder]="'Search ' + role + 's'"
|
|
|
|
[bordered]="true" colorClass="uk-text-secondary">
|
|
|
|
</div>
|
|
|
|
<div *ngIf="!showCurrent" search-input [control]="filterForm.get('active')" [showSearch]="false" [placeholder]="'Search invitations'"
|
|
|
|
[bordered]="true" colorClass="uk-text-secondary">
|
|
|
|
</div>
|
|
|
|
<a *ngIf="exists" class="uk-text-uppercase uk-flex uk-flex-middle uk-flex-center" (click)="openInviteModal()">
|
2020-11-03 19:25:03 +01:00
|
|
|
<button class="uk-icon-button large uk-button-secondary">
|
|
|
|
<icon name="person_add"></icon>
|
|
|
|
</button>
|
|
|
|
<button class="uk-button uk-button-link uk-margin-small-left uk-text-secondary">Invite {{role}}</button>
|
|
|
|
</a>
|
2021-03-28 13:07:48 +02:00
|
|
|
<a *ngIf="!exists && isPortalAdmin" class="uk-text-uppercase uk-flex uk-flex-middle uk-flex-center"
|
2021-01-21 16:15:53 +01:00
|
|
|
(click)="openCreateRoleModal()">
|
2020-11-03 19:25:03 +01:00
|
|
|
<button class="uk-icon-button large uk-button-secondary">
|
|
|
|
<icon name="person_add"></icon>
|
|
|
|
</button>
|
|
|
|
<button class="uk-button uk-button-link uk-margin-small-left uk-text-secondary">Create Group</button>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div inner>
|
2021-03-18 15:11:41 +01:00
|
|
|
<div *ngIf="loadActive || loadPending" class="uk-position-center">
|
2020-11-03 19:25:03 +01:00
|
|
|
<loading></loading>
|
|
|
|
</div>
|
2021-01-21 16:15:53 +01:00
|
|
|
<div *ngIf="!loadActive && !loadPending">
|
2021-03-28 13:07:48 +02:00
|
|
|
<div *ngIf="(showCurrent && showActive.length == 0) || (!showCurrent && showPending.length == 0)"
|
2020-11-03 19:25:03 +01:00
|
|
|
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
|
2021-03-28 13:07:48 +02:00
|
|
|
<div *ngIf="showCurrent">No {{role}}s found</div>
|
|
|
|
<div *ngIf="!showCurrent">No pending {{role}} invitations found</div>
|
2020-11-03 19:25:03 +01:00
|
|
|
</div>
|
2021-03-28 13:07:48 +02:00
|
|
|
<div *ngIf="(showCurrent && showActive.length > 0) || (!showCurrent && showPending.length > 0)">
|
|
|
|
<no-load-paging *ngIf="showCurrent" [type]="(showActive.length > 1)?(role + 's'):role"
|
|
|
|
(pageChange)="updateActivePage($event)"
|
|
|
|
[page]="activePage" [pageSize]="pageSize"
|
|
|
|
[totalResults]="showActive.length">
|
|
|
|
</no-load-paging>
|
|
|
|
<no-load-paging *ngIf="!showCurrent" [type]="role + ' ' + (showPending.length > 1?'invitations':'invitation')"
|
|
|
|
(pageChange)="updatePendingPage($event)"
|
|
|
|
[page]="pendingPage" [pageSize]="pageSize"
|
|
|
|
[totalResults]="showPending.length">
|
|
|
|
</no-load-paging>
|
2020-11-03 19:25:03 +01:00
|
|
|
<div class="uk-card uk-card-default uk-card-body uk-text-small uk-margin-bottom"
|
2021-04-08 16:35:39 +02:00
|
|
|
*ngFor="let item of (showCurrent)?(currentActivePage):(currentPendingPage)">
|
2021-03-01 18:32:21 +01:00
|
|
|
<div class="uk-grid uk-grid-divider uk-flex-middle" uk-grid>
|
|
|
|
<div class="uk-width-expand@m uk-width-1-1">
|
2020-11-03 19:25:03 +01:00
|
|
|
<div class="uk-padding-small uk-padding-remove-horizontal">
|
|
|
|
<span class="uk-text-muted">Email: </span>
|
2021-03-28 13:07:48 +02:00
|
|
|
<span class="uk-text-bold">{{(showCurrent) ? item.email : item}}</span>
|
2020-11-03 19:25:03 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-03-28 13:07:48 +02:00
|
|
|
<div *ngIf="isCurator || !showCurrent" class="uk-width-auto@m uk-width-1-1">
|
2021-03-01 18:32:21 +01:00
|
|
|
<div class="uk-width-1-1 uk-flex uk-flex-center">
|
|
|
|
<div class="uk-padding-small uk-padding-remove-horizontal">
|
2021-03-02 11:08:19 +01:00
|
|
|
<button (click)="openDeleteModal(item)" class="uk-button action uk-flex uk-flex-middle" [disabled]="role === 'member' && item.isManager"
|
|
|
|
[attr.uk-tooltip]="(role === 'member' && item.isManager)?'This user is a manager and cannot be removed.':null">
|
2021-03-24 01:26:56 +01:00
|
|
|
<icon name="remove_circle_outline" [flex]="true"></icon>
|
2021-03-28 13:07:48 +02:00
|
|
|
<span class="uk-margin-small-left">{{showCurrent ? ('Remove ' + role) : 'Cancel invitation'}}</span>
|
2021-03-02 11:08:19 +01:00
|
|
|
</button>
|
2021-03-01 18:32:21 +01:00
|
|
|
</div>
|
2020-11-03 19:25:03 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-03-28 13:07:48 +02:00
|
|
|
<no-load-paging *ngIf="showCurrent" [type]="(showActive.length > 1)?(role + 's'):role"
|
|
|
|
(pageChange)="updateActivePage($event)"
|
|
|
|
[page]="activePage" [pageSize]="pageSize"
|
|
|
|
[totalResults]="showActive.length">
|
|
|
|
</no-load-paging>
|
|
|
|
<no-load-paging *ngIf="!showCurrent" [type]="role + ' ' + (showPending.length > 1?'invitations':'invitation')"
|
|
|
|
(pageChange)="updatePendingPage($event)"
|
|
|
|
[page]="pendingPage" [pageSize]="pageSize"
|
|
|
|
[totalResults]="showPending.length">
|
|
|
|
</no-load-paging>
|
2020-11-03 19:25:03 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<modal-alert #inviteModal (alertOutput)="invite()" [okDisabled]="invited && invited.invalid">
|
2020-11-19 18:13:27 +01:00
|
|
|
<div class="uk-padding uk-padding-remove-horizontal">
|
2021-01-15 11:47:57 +01:00
|
|
|
<div *ngIf="message" class="uk-margin-medium-bottom uk-text-small">
|
|
|
|
<div [innerHTML]="message | safeHtml"></div>
|
2020-11-19 18:13:27 +01:00
|
|
|
</div>
|
|
|
|
<div *ngIf="invited" class="uk-text-center">
|
|
|
|
<div dashboard-input [formInput]="invited"
|
|
|
|
placeholder="Write an email..."></div>
|
|
|
|
</div>
|
2020-11-03 19:25:03 +01:00
|
|
|
</div>
|
|
|
|
</modal-alert>
|
|
|
|
<modal-alert #deleteModal (alertOutput)="deleteActive()">
|
|
|
|
<div *ngIf="selectedUser" class="uk-padding-small uk-padding-remove-horizontal">
|
|
|
|
Are you sure you want to remove <span class="uk-text-bold">{{selectedUser}}</span> from {{role}}s?
|
|
|
|
</div>
|
|
|
|
</modal-alert>
|
|
|
|
<modal-alert #deletePendingModal (alertOutput)="deletePending()">
|
|
|
|
<div *ngIf="selectedUser" class="uk-padding-small uk-padding-remove-horizontal">
|
|
|
|
Are you sure you want to cancel {{role}} invitation of <span class="uk-text-bold">{{selectedUser}}</span>?
|
|
|
|
</div>
|
|
|
|
</modal-alert>
|
|
|
|
<modal-alert #createRoleModal (alertOutput)="createGroup()" [okDisabled]="roleFb && roleFb.invalid">
|
|
|
|
<div *ngIf="roleFb" class="uk-padding uk-padding-remove-horizontal">
|
|
|
|
<div class="uk-grid" uk-grid [formGroup]="roleFb">
|
|
|
|
<div dashboard-input [formInput]="roleFb.get('name')"
|
|
|
|
label="Name"
|
|
|
|
placeholder="Write a name..." class="uk-width-1-1"></div>
|
|
|
|
<div dashboard-input [formInput]="roleFb.get('description')"
|
|
|
|
label="Description"
|
|
|
|
type="textarea"
|
|
|
|
placeholder="Write a description..." class="uk-width-1-1"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</modal-alert>
|