openaire-library/dashboard/users/subscribers/subscribers.component.html

104 lines
5.1 KiB
HTML

<div page-content>
<div header>
<ng-content></ng-content>
<div [class.uk-invisible]="loading"
class="uk-flex uk-flex-right@m uk-flex-center uk-flex-wrap uk-flex-middle uk-grid" uk-grid>
<div search-input [control]="filterForm.get('keyword')" [showSearch]="false" placeholder="Search subscribers"
[bordered]="true" colorClass="uk-text-secondary">
</div>
<div>
<a *ngIf="exists" class="uk-text-uppercase uk-flex uk-flex-middle" [attr.uk-tooltip]="(inviteDisableMessage)">
<button class="uk-icon-button large uk-button-secondary" (click)="openInviteModal()"
[disabled]="!subscriberInvite || subscriberInvite.loading || !!inviteDisableMessage">
<icon name="person_add"></icon>
</button>
<button class="uk-button uk-button-link uk-margin-small-left" (click)="openInviteModal()"
[disabled]="!subscriberInvite || subscriberInvite.loading || !!inviteDisableMessage"
[class.uk-text-secondary]="subscriberInvite && !subscriberInvite.loading && !inviteDisableMessage">
Invite Subscribers
</button>
</a>
<a *ngIf="!exists && isPortalAdmin" class="uk-text-uppercase uk-flex uk-flex-middle"
(click)="openCreateRoleModal()">
<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>
<div *ngIf="loading" class="uk-position-center">
<loading></loading>
</div>
<div *ngIf="!loading">
<div *ngIf="showSubscribers.length == 0"
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
<div>No subscribers found</div>
</div>
<div *ngIf="showSubscribers.length > 0">
<no-load-paging [type]="(subscribers.length > 1)?'subscribers':'subscriber'"
(pageChange)="updatePage($event)"
[page]="page" [pageSize]="pageSize"
[totalResults]="showSubscribers.length">
</no-load-paging>
<div class="uk-margin-top uk-margin-medium-bottom">
<div class="uk-card uk-card-default uk-card-body uk-text-small uk-margin-bottom"
*ngFor="let item of currentPage">
<div class="uk-grid uk-grid-divider uk-flex uk-flex-middle" uk-grid>
<div class="uk-width-expand@m uk-width-1-1">
<div class="uk-padding-small uk-padding-remove-horizontal">
<span class="uk-text-muted">Email: </span>
<span class="uk-text-bold">{{item.email}}</span>
</div>
</div>
<div class="uk-width-auto@m uk-width-1-1">
<div class="uk-width-1-1 uk-flex uk-flex-center">
<div class="uk-padding-small uk-padding-remove-horizontal">
<button (click)="openDeleteModal(item)" class="uk-button action uk-flex uk-flex-middle"
[disabled]="item.isManager"
[attr.uk-tooltip]="item.isManager?'This user is a manager and cannot be removed.':null">
<icon name="remove_circle_outline" [flex]="true"></icon>
<span class="uk-margin-small-left">Remove subscriber</span>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<no-load-paging *ngIf="showSubscribers.length > pageSize" [type]="'subscribers'"
(pageChange)="updatePage($event)"
[page]="page" [pageSize]="pageSize"
[totalResults]="showSubscribers.length">
</no-load-paging>
</div>
</div>
</div>
</div>
<modal-alert *ngIf="user" #inviteModal (alertOutput)="subscriberInvite.invite()" [okDisabled]="!subscriberInvite.valid"
[large]="true">
<div class="uk-padding uk-padding-remove-horizontal">
<subscriber-invite #subscriberInvite [user]="user"></subscriber-invite>
</div>
</modal-alert>
<modal-alert #deleteModal (alertOutput)="deleteSubscriber()">
<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 subscribers?
</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>