2021-01-11 19:33:24 +01:00
|
|
|
<div page-content class="admin-pages">
|
|
|
|
<div header>
|
|
|
|
<admin-tabs tab="class" header></admin-tabs>
|
2021-01-13 15:47:28 +01:00
|
|
|
<div *ngIf="!errorMessage && !showLoading" class="uk-grid" uk-grid>
|
2021-01-11 19:33:24 +01:00
|
|
|
<div class="uk-width-1-1">
|
|
|
|
<ul class="uk-subnav uk-subnav-pill">
|
|
|
|
<li [class.uk-active]="filterForm.get('type').value === 'all'" class="uk-margin-small-bottom"><a
|
|
|
|
(click)="filterForm.get('type').setValue('all')"><span
|
|
|
|
class="title">All portals</span></a></li>
|
|
|
|
<li *ngFor="let type of portalUtils.portalTypes; let i=index"
|
|
|
|
[class.uk-active]="filterForm.get('type').value === type.value" class="uk-margin-small-bottom"><a
|
|
|
|
(click)="filterForm.get('type').setValue(type.value)"><span
|
|
|
|
class="title">{{type.label}}</span></a></li>
|
2021-01-11 10:21:42 +01:00
|
|
|
</ul>
|
2019-12-18 16:14:21 +01:00
|
|
|
</div>
|
2021-01-12 11:23:26 +01:00
|
|
|
<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>
|
2021-01-11 19:33:24 +01:00
|
|
|
<div search-input [control]="filterForm.controls.keyword" [showSearch]="false" placeholder="Search"
|
|
|
|
[bordered]="true" colorClass="uk-text-secondary"></div>
|
2021-01-12 11:23:26 +01:00
|
|
|
<div class="show-options">
|
2021-01-11 19:33:24 +01:00
|
|
|
<button class="uk-button uk-button-secondary">Bulk Actions</button>
|
|
|
|
<div uk-dropdown="mode: click">
|
2021-01-12 11:28:09 +01:00
|
|
|
<ul class="uk-nav uk-dropdown-nav"
|
2021-01-11 19:33:24 +01:00
|
|
|
[attr.uk-tooltip]="getSelectedDivIds().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
|
|
|
|
title="Select at least one class">
|
|
|
|
<li><a [class]="getSelectedDivIds().length == 0 ? 'uk-disabled' : ''"
|
|
|
|
(click)="confirmDeleteSelectedDivIds()"><i></i> Delete </a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-01-12 11:23:26 +01:00
|
|
|
<div>
|
2021-01-11 19:33:24 +01:00
|
|
|
<a (click)="newDivId()"
|
|
|
|
class="uk-flex uk-flex-middle uk-text-uppercase">
|
|
|
|
<button class="large uk-icon-button uk-button-secondary">
|
|
|
|
<icon name="add"></icon>
|
|
|
|
</button>
|
|
|
|
<button class="uk-button uk-button-link uk-margin-small-left uk-text-secondary">Add class</button>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-12-18 16:14:21 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-01-11 19:33:24 +01:00
|
|
|
<div inner>
|
|
|
|
<div>
|
|
|
|
<div class="contentPanel">
|
|
|
|
<div *ngIf="updateErrorMessage" class="uk-alert-danger" uk-alert>
|
|
|
|
<a class="uk-alert-close" uk-close></a>
|
|
|
|
{{updateErrorMessage}}
|
2021-01-11 10:21:42 +01:00
|
|
|
</div>
|
2021-01-11 19:33:24 +01:00
|
|
|
<div *ngIf="errorMessage" class="uk-alert uk-alert-danger uk-margin-large-top"
|
|
|
|
role="alert">{{errorMessage}}</div>
|
|
|
|
<div [style.display]="showLoading ? 'inline' : 'none'"
|
|
|
|
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><img
|
2019-12-18 16:14:21 +01:00
|
|
|
class="uk-align-center loading-gif"></div>
|
|
|
|
|
2021-01-11 19:33:24 +01:00
|
|
|
<div class="md-card uk-margin-medium-bottom" *ngIf="!errorMessage && !showLoading">
|
|
|
|
<div class="md-card-content">
|
|
|
|
<div class="uk-overflow-container">
|
2019-12-18 16:14:21 +01:00
|
|
|
|
2021-01-11 19:33:24 +01:00
|
|
|
<table class="uk-table uk-table-striped uk-table-large">
|
2021-01-28 17:55:09 +01:00
|
|
|
<thead class="uk-card-header">
|
2021-01-11 19:33:24 +01:00
|
|
|
<tr>
|
|
|
|
<th
|
|
|
|
class="uk-width-small"><input id="allDivIdCheckbox" type="checkbox"
|
|
|
|
(change)="toggleCheckBoxes($event)"></th>
|
|
|
|
<th>Name</th>
|
|
|
|
<th *ngIf="!selectedCommunityPid">Portal Type</th>
|
|
|
|
<th>Page</th>
|
|
|
|
<th>Actions</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr *ngFor="let check of checkboxes; let i=index">
|
|
|
|
<td><input id="{{check.divId._id}}" class="checkBox" type="checkbox"
|
|
|
|
name="divIdscb[]" value="{{check.divId._id}}" [(ngModel)]="check.checked">
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<div class="name" href="#">{{check.divId.name}}</div>
|
|
|
|
</td>
|
|
|
|
<td *ngIf="!selectedCommunityPid">
|
|
|
|
<div class="portalType" href="#">{{check.divId.portalType}}</div>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<div class="pages" href="#">
|
2019-12-18 16:14:21 +01:00
|
|
|
<span *ngFor="let page of check.divId.pages let i=index">{{page.name}}<span
|
2021-01-11 19:33:24 +01:00
|
|
|
*ngIf="i<(check.divId.pages.length-1)">, </span></span>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
<td>
|
2019-12-18 16:14:21 +01:00
|
|
|
|
2021-01-11 19:33:24 +01:00
|
|
|
<div class="actions" href="#">
|
|
|
|
<i class="clickable" uk-icon="pencil" (click)="editDivId(i)"></i>
|
|
|
|
<i class="clickable uk-text-danger" uk-icon="trash"
|
|
|
|
(click)="confirmDeleteDivId(check.divId._id)"></i>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<div *ngIf="checkboxes.length==0" class="col-md-12">
|
|
|
|
<div class="uk-alert-warning uk-alert">No classes found</div>
|
|
|
|
</div>
|
2019-12-18 16:14:21 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-01-11 19:33:24 +01:00
|
|
|
</div>
|
2021-01-28 17:33:16 +01:00
|
|
|
<modal-alert #editModal (alertOutput)="divIdSaveConfirmed($event)"
|
|
|
|
[okDisabled]="classForm && (classForm.invalid || !classForm.dirty)">
|
2019-12-18 16:14:21 +01:00
|
|
|
<div *ngIf="modalErrorMessage" class="uk-alert-danger" uk-alert aria-hidden="true">{{ modalErrorMessage }}</div>
|
2021-01-28 17:33:16 +01:00
|
|
|
<form *ngIf="classForm" [formGroup]="classForm" class="uk-grid uk-child-width-1-1" uk-grid>
|
|
|
|
<div dashboard-input [formInput]="classForm.get('name')"
|
|
|
|
type="text" label="Class Name" placeholder="Write a name">
|
2019-12-18 16:14:21 +01:00
|
|
|
</div>
|
2021-01-28 17:33:16 +01:00
|
|
|
<div dashboard-input [formInput]="classForm.get('pages')" placeholder="Add a page"
|
|
|
|
type="chips" [options]="allPages" label="Pages" chipLabel="name">
|
2019-12-18 16:14:21 +01:00
|
|
|
</div>
|
2021-01-28 17:33:16 +01:00
|
|
|
<div dashboard-input type="select" label="Portal Type" placeholder="Choose a type"
|
|
|
|
[formInput]="classForm.get('portalType')" [options]="portalUtils.portalTypes"></div>
|
2019-12-18 16:14:21 +01:00
|
|
|
</form>
|
|
|
|
</modal-alert>
|
2021-01-28 17:33:16 +01:00
|
|
|
<modal-alert #deleteModal (alertOutput)="confirmedDeleteDivIds($event)"></modal-alert>
|