1
|
<div page-content class="admin-pages">
|
2
|
<div header>
|
3
|
<admin-tabs tab="entity" [portal]="portal"></admin-tabs>
|
4
|
<div *ngIf="!errorMessage && !showLoading" class="uk-grid" uk-grid>
|
5
|
<div class="uk-width-1-1">
|
6
|
<ul *ngIf="!isPortalAdministrator" class="uk-subnav uk-subnav-pill">
|
7
|
<li [class.uk-active]="filterForm.get('status').value === 'all'"><a
|
8
|
(click)="filterForm.get('status').setValue('all')"><span
|
9
|
class="title">All entities</span></a></li>
|
10
|
<li [class.uk-active]="filterForm.get('status').value === 'enabled'"><a
|
11
|
(click)="filterForm.get('status').setValue('enabled')"><span class="title">Enabled</span></a></li>
|
12
|
<li [class.uk-active]="filterForm.get('status').value === 'disabled'"><a
|
13
|
(click)="filterForm.get('status').setValue('disabled')"><span class="title">Disabled</span></a></li>
|
14
|
</ul>
|
15
|
</div>
|
16
|
<div class="uk-width-1-1 uk-flex uk-flex-right@m uk-flex-center uk-flex-wrap uk-flex-middle uk-grid" uk-grid>
|
17
|
<div search-input [control]="filterForm.controls.keyword" [showSearch]="false" placeholder="Search entity"
|
18
|
[bordered]="true" colorClass="uk-text-secondary"></div>
|
19
|
<div class="show-options">
|
20
|
<button class="uk-button uk-button-secondary">Bulk Actions</button>
|
21
|
<div uk-dropdown="mode: click">
|
22
|
<ul class="uk-nav uk-dropdown-nav"
|
23
|
[attr.uk-tooltip]="getSelectedEntities().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
|
24
|
title="Select at least one entity">
|
25
|
<li *ngIf="!isPortalAdministrator"><a [class]="getSelectedEntities().length == 0 ? 'uk-disabled' : ''"
|
26
|
(click)="toggleEntities(true, getSelectedEntities())"><i></i>
|
27
|
Activate
|
28
|
</a></li>
|
29
|
<li *ngIf="!isPortalAdministrator"><a [class]="getSelectedEntities().length == 0 ? 'uk-disabled' : ''"
|
30
|
(click)="toggleEntities(false, getSelectedEntities())"><i></i>
|
31
|
Deactivate
|
32
|
</a></li>
|
33
|
<li *ngIf="isPortalAdministrator"><a [class]="getSelectedEntities().length == 0 ? 'uk-disabled' : ''"
|
34
|
(click)="confirmDeleteSelectedEntities()"><i></i> Delete </a></li>
|
35
|
</ul>
|
36
|
</div>
|
37
|
</div>
|
38
|
<div *ngIf="isPortalAdministrator">
|
39
|
<a (click)="newEntity()"
|
40
|
class="uk-flex uk-flex-middle uk-text-uppercase">
|
41
|
<button class="large uk-icon-button uk-button-secondary">
|
42
|
<icon name="add"></icon>
|
43
|
</button>
|
44
|
<button class="uk-button uk-button-link uk-margin-small-left uk-text-secondary">Add entity</button>
|
45
|
</a>
|
46
|
</div>
|
47
|
</div>
|
48
|
</div>
|
49
|
</div>
|
50
|
<div inner>
|
51
|
<div class="contentPanel ">
|
52
|
<div *ngIf="!isPortalAdministrator" class="uk-alert uk-alert-primary uk-margin-top-large">
|
53
|
<div>
|
54
|
<span class="uk-margin-small-right uk-icon" uk-icon="warning"></span>
|
55
|
Disable an entity to hide it from community dashboard portal.
|
56
|
</div>
|
57
|
<div
|
58
|
class="uk-text-small">If an entity is disabled, all related search and advanced search pages will be
|
59
|
hidden from the community dashborad and a message "Can't find that page" will appear in case the url of that
|
60
|
page is loaded. If the related page belongs to the menu the link will be removed from menu, too.
|
61
|
</div>
|
62
|
|
63
|
</div>
|
64
|
<div *ngIf="updateErrorMessage" class="uk-alert-danger" uk-alert>
|
65
|
<a class="uk-alert-close" uk-close></a>
|
66
|
{{updateErrorMessage}}
|
67
|
</div>
|
68
|
<div *ngIf="errorMessage" class="uk-alert uk-alert-danger uk-margin-large-top"
|
69
|
role="alert">{{errorMessage}}</div>
|
70
|
<div [style.display]="showLoading ? 'inline' : 'none'"
|
71
|
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><img
|
72
|
class="uk-align-center loading-gif"></div>
|
73
|
|
74
|
|
75
|
<div class="md-card uk-margin-medium-bottom" *ngIf="!errorMessage && !showLoading">
|
76
|
<div class="md-card-content">
|
77
|
<div class="uk-overflow-container">
|
78
|
<table class="uk-table uk-table-striped uk-table-hover uk-table-large">
|
79
|
<thead class="uk-card-header">
|
80
|
<tr>
|
81
|
<th
|
82
|
class="uk-width-small"><input id="allEntityCheckbox" type="checkbox"
|
83
|
(change)="toggleCheckBoxes($event)"></th>
|
84
|
<th>Name</th>
|
85
|
<th *ngIf="!isPortalAdministrator">Status</th>
|
86
|
<th *ngIf="!isPortalAdministrator">Enable/Disable</th>
|
87
|
<th *ngIf="isPortalAdministrator">Actions</th>
|
88
|
</tr>
|
89
|
</thead>
|
90
|
<tbody>
|
91
|
<tr *ngFor="let check of checkboxes; let i=index">
|
92
|
<td><input id="{{check.entity._id}}" class="checkBox" type="checkbox"
|
93
|
name="entitiescb[]" value="{{check.entity._id}}" [(ngModel)]="check.checked">
|
94
|
</td>
|
95
|
<td>
|
96
|
<div class="name" href="#">{{check.entity.name}}</div>
|
97
|
</td>
|
98
|
<td *ngIf="!isPortalAdministrator">
|
99
|
<div class="name" href="#">{{check.entity.isEnabled ? "Enabled" : "Disabled"}}</div>
|
100
|
</td>
|
101
|
<td *ngIf="!isPortalAdministrator">
|
102
|
<mat-slide-toggle [checked]="check.entity.isEnabled"
|
103
|
(change)="($event.source.checked = check.entity.isEnabled);toggleEntities(!check.entity.isEnabled,[check.entity._id])"></mat-slide-toggle>
|
104
|
</td>
|
105
|
|
106
|
<td *ngIf="isPortalAdministrator">
|
107
|
<div class="actions" href="#">
|
108
|
<i class="clickable " uk-icon="pencil" (click)="editEntity(i)"></i>
|
109
|
<i class="clickable uk-text-danger" uk-icon="trash"
|
110
|
(click)="confirmDeleteEntity(check.entity._id)"></i>
|
111
|
</div>
|
112
|
</td>
|
113
|
</tr>
|
114
|
</tbody>
|
115
|
</table>
|
116
|
<div *ngIf="checkboxes.length ==0 ">
|
117
|
<div class="uk-alert-warning" uk-alert>No entities found</div>
|
118
|
</div>
|
119
|
</div>
|
120
|
</div>
|
121
|
|
122
|
</div>
|
123
|
</div>
|
124
|
</div>
|
125
|
</div>
|
126
|
|
127
|
<modal-alert #editModal (alertOutput)="entitySaveConfirmed($event)"
|
128
|
[okDisabled]="entityForm && (entityForm.invalid || !entityForm.dirty)">
|
129
|
<div *ngIf="modalErrorMessage" class="uk-alert-danger" uk-alert aria-hidden="true">{{ modalErrorMessage }}</div>
|
130
|
<form *ngIf="entityForm" [formGroup]="entityForm" class="uk-grid uk-child-width-1-1" uk-grid>
|
131
|
<div dashboard-input [formInput]="entityForm.get('name')"
|
132
|
type="text" placeholder="Write a name"
|
133
|
label="Entity Name">
|
134
|
</div>
|
135
|
<div dashboard-input [formInput]="entityForm.get('pid')"
|
136
|
type="text" placeholder="Write a pid"
|
137
|
label="Entity Pid">
|
138
|
</div>
|
139
|
</form>
|
140
|
</modal-alert>
|
141
|
|
142
|
<modal-alert #relatedPages (alertOutput)="continueToggling($event)"></modal-alert>
|
143
|
|
144
|
<modal-alert #deleteModal (alertOutput)="confirmedDeleteEntities($event)"></modal-alert>
|