1
|
<div page-content class="admin-pages">
|
2
|
<div header>
|
3
|
<admin-tabs tab="page" [portal]="portal"></admin-tabs>
|
4
|
<div *ngIf="!errorMessage && !showLoading" class="uk-grid" uk-grid>
|
5
|
<div class="uk-width-1-1">
|
6
|
<ul class="uk-subnav uk-subnav-pill">
|
7
|
<li [class.uk-active]="filterForm.get('type').value === 'all'"><a
|
8
|
(click)="filterForm.get('type').setValue('all')"><span
|
9
|
class="title">All pages</span></a></li>
|
10
|
<li *ngFor="let type of typeOptions; let i=index"
|
11
|
[class.uk-active]="filterForm.get('type').value === type.value"><a
|
12
|
(click)="filterForm.get('type').setValue(type.value)"><span
|
13
|
class="title">{{type.label}}</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 page"
|
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]="getSelectedPages().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
|
24
|
title="Select at least one page">
|
25
|
<li *ngIf="!isPortalAdministrator"><a [class]="getSelectedPages().length == 0 ? 'uk-disabled' : ''"
|
26
|
(click)="togglePages(true, getSelectedPages())"> Activate
|
27
|
</a></li>
|
28
|
<li *ngIf="!isPortalAdministrator"><a [class]="getSelectedPages().length == 0 ? 'uk-disabled' : ''"
|
29
|
(click)="togglePages(false, getSelectedPages())"> Deactivate
|
30
|
</a></li>
|
31
|
<li *ngIf="isPortalAdministrator"><a (click)="confirmDeleteSelectedPages()"> Delete </a></li>
|
32
|
</ul>
|
33
|
</div>
|
34
|
</div>
|
35
|
<div *ngIf="isPortalAdministrator">
|
36
|
<a (click)="newPage()"
|
37
|
class="uk-flex uk-flex-middle uk-text-uppercase">
|
38
|
<button class="large uk-icon-button uk-button-secondary">
|
39
|
<icon name="add"></icon>
|
40
|
</button>
|
41
|
<button class="uk-button uk-button-link uk-margin-small-left uk-text-secondary">Add page</button>
|
42
|
</a>
|
43
|
</div>
|
44
|
</div>
|
45
|
</div>
|
46
|
</div>
|
47
|
<div inner>
|
48
|
<div class="contentPanel ">
|
49
|
<div *ngIf="!isPortalAdministrator" class="uk-alert uk-alert-primary uk-margin-top-large">
|
50
|
<div>
|
51
|
<span class="uk-margin-small-right uk-icon" uk-icon="warning"></span>
|
52
|
Disable a page to hide it from community dashboard portal.
|
53
|
</div>
|
54
|
<div
|
55
|
class="uk-text-small">If the page is disabled, a message "Can't find that page" will appear in case the url
|
56
|
of that page is loaded. If the disabled page belongs to the menu, the link will be removed from menu, too.
|
57
|
</div>
|
58
|
|
59
|
</div>
|
60
|
<div *ngIf="updateErrorMessage" class="uk-alert-danger" uk-alert>
|
61
|
<a class="uk-alert-close" uk-close></a>
|
62
|
{{updateErrorMessage}}
|
63
|
</div>
|
64
|
<div *ngIf="errorMessage" class="uk-alert uk-alert-danger uk-margin-large-top"
|
65
|
role="alert">{{errorMessage}}</div>
|
66
|
<div [style.display]="showLoading ? 'inline' : 'none'"
|
67
|
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><img
|
68
|
class="uk-align-center loading-gif"></div>
|
69
|
<div class="md-card uk-margin-medium-bottom" *ngIf="!errorMessage && !showLoading">
|
70
|
<div class="md-card-content">
|
71
|
<div class="uk-overflow-container">
|
72
|
<ul class="uk-list pages">
|
73
|
<li *ngFor="let check of checkboxes; let i=index" class="uk-card uk-card-default uk-margin-bottom">
|
74
|
<div class="uk-grid uk-padding">
|
75
|
<div class=""><input id="{{check.page._id}}" class="checkBox" type="checkbox"
|
76
|
name="pagescb[]" value="{{check.page._id}}" [(ngModel)]="check.checked">
|
77
|
</div>
|
78
|
<div class="uk-width-expand">
|
79
|
<div class="title uk-margin-medium-bottom">Name</div>
|
80
|
<div class="name uk-margin-medium-bottom" href="#">{{check.page.name}}</div>
|
81
|
<div *ngIf="check.page.entities && check.page.entities.length > 0"><span
|
82
|
class="title">Entities: </span>
|
83
|
{{check.page.entities.join(", ")}}</div>
|
84
|
<div class=" uk-margin-small-bottom"><span class="title">Route: </span> {{check.page.route}}</div>
|
85
|
<div *ngIf="!pagesType" class=" uk-margin-small-bottom"><span
|
86
|
class="title">Type: </span> {{check.page.type}}</div>
|
87
|
<div *ngIf="!portal" class=" uk-margin-small-bottom">
|
88
|
<span class="title">Portal type: </span>{{check.page.portalType}}
|
89
|
</div>
|
90
|
</div>
|
91
|
<div *ngIf="isPortalAdministrator" class="uk-width-1-4">
|
92
|
<div class="title uk-margin-medium-bottom">Actions</div>
|
93
|
<div class="actions" href="#">
|
94
|
<i class="clickable " (click)="editPage(i)" uk-icon="pencil"></i>
|
95
|
<i class="clickable uk-text-danger"
|
96
|
(click)="confirmDeletePage(check.page._id)" uk-icon="trash"></i>
|
97
|
</div>
|
98
|
</div>
|
99
|
<div *ngIf="!isPortalAdministrator" class="uk-width-1-4">
|
100
|
<div class="title uk-margin-medium-bottom">Helptexts</div>
|
101
|
<div class=" uk-margin-small-bottom">
|
102
|
<a *ngIf="check.page.top || check.page.bottom || check.page.left || check.page.right"
|
103
|
class="helpContents"
|
104
|
[queryParams]="{communityId: portal, pageId: check.page._id}"
|
105
|
routerLink="../../helptexts">
|
106
|
manage help texts
|
107
|
</a>
|
108
|
</div>
|
109
|
<div>
|
110
|
<a *ngIf="pageWithDivIds.includes(check.page._id)" class="classHelpContents"
|
111
|
[queryParams]="{communityId: portal, pageId: check.page._id}"
|
112
|
routerLink="../../classContents">manage class contents</a>
|
113
|
</div>
|
114
|
</div>
|
115
|
<div *ngIf="!isPortalAdministrator" class="uk-width-1-4">
|
116
|
<div class="title uk-margin-medium-bottom">Enable/disable</div>
|
117
|
<mat-slide-toggle [checked]="check.page.isEnabled"
|
118
|
(change)="($event.source.checked = check.page.isEnabled);togglePages(!check.page.isEnabled,[check.page._id])"></mat-slide-toggle>
|
119
|
</div>
|
120
|
</div>
|
121
|
</li>
|
122
|
|
123
|
</ul>
|
124
|
<div *ngIf="checkboxes.length==0">
|
125
|
<div class="uk-alert-warning" uk-alert>No pages found</div>
|
126
|
</div>
|
127
|
</div>
|
128
|
</div>
|
129
|
</div>
|
130
|
</div>
|
131
|
</div>
|
132
|
</div>
|
133
|
|
134
|
<modal-alert #editModal (alertOutput)="pageSaveConfirmed($event)"
|
135
|
[okDisabled]="pageForm && (pageForm.invalid || !pageForm.dirty)">
|
136
|
<div *ngIf="modalErrorMessage" class="uk-alert-danger" uk-alert aria-hidden="true">{{ modalErrorMessage }}</div>
|
137
|
<form *ngIf="pageForm" [formGroup]="pageForm" class="uk-grid uk-child-width-1-1" uk-grid>
|
138
|
<div dashboard-input [formInput]="pageForm.get('route')"
|
139
|
type="text" label="Page route" placeholder="Write a route">
|
140
|
</div>
|
141
|
<div dashboard-input [formInput]="pageForm.get('name')"
|
142
|
type="text" placeholder="Write a name"
|
143
|
label="Page Name">
|
144
|
</div>
|
145
|
<div dashboard-input [formInput]="pageForm.get('type')"
|
146
|
type="select" placeholder="Choose a page Type"
|
147
|
label="Type" [options]="typeOptions">
|
148
|
</div>
|
149
|
<div dashboard-input [formInput]="pageForm.get('entities')" placeholder="Add an entity"
|
150
|
type="chips" [options]="allEntities" label="Entities" chipLabel="name">
|
151
|
</div>
|
152
|
<div dashboard-input type="select" label="Portal Type" placeholder="Choose a type"
|
153
|
[formInput]="pageForm.get('portalType')" [options]="portalUtils.portalTypes"></div>
|
154
|
<div class="form-group">
|
155
|
<div class="uk-form-label uk-text-bold uk-margin-small-bottom"> Select if this page have helptext at: </div>
|
156
|
<div class="uk-grid uk-grid-small uk-child-width-1-4" uk-grid>
|
157
|
<div dashboard-input [formInput]="pageForm.get('top')"
|
158
|
type="checkbox"
|
159
|
label="Top">
|
160
|
</div>
|
161
|
<div dashboard-input [formInput]="pageForm.get('right')"
|
162
|
type="checkbox"
|
163
|
label="Right">
|
164
|
</div>
|
165
|
<div dashboard-input [formInput]="pageForm.get('bottom')"
|
166
|
type="checkbox"
|
167
|
label="Bottom">
|
168
|
</div>
|
169
|
<div dashboard-input [formInput]="pageForm.get('left')"
|
170
|
type="checkbox"
|
171
|
label="Left">
|
172
|
</div>
|
173
|
</div>
|
174
|
<label class="uk-text-danger">
|
175
|
By disabling a position, all contents in this position will be deleted.
|
176
|
</label>
|
177
|
</div>
|
178
|
</form>
|
179
|
|
180
|
</modal-alert>
|
181
|
|
182
|
<modal-alert #deleteModal (alertOutput)="confirmedDeletePages($event)"></modal-alert>
|