2021-01-11 19:33:24 +01:00
|
|
|
<div page-content class="admin-pages">
|
|
|
|
<div header>
|
|
|
|
<admin-tabs tab="page" [portal]="selectedCommunityPid"></admin-tabs>
|
|
|
|
<div *ngIf="!errorMessage && !showLoading" class="uk-grid filters" uk-grid>
|
|
|
|
<div class="uk-width-1-1">
|
|
|
|
<ul class="uk-subnav uk-subnav-pill">
|
|
|
|
<li [class.uk-active]="filterForm.get('type').value === 'all'"><a
|
|
|
|
(click)="filterForm.get('type').setValue('all')"><span
|
|
|
|
class="title">All pages</span></a></li>
|
|
|
|
<li *ngFor="let type of typeOptions; let i=index"
|
|
|
|
[class.uk-active]="filterForm.get('type').value === type.value"><a
|
|
|
|
(click)="filterForm.get('type').setValue(type.value)"><span
|
|
|
|
class="title">{{type.label}}</span></a></li>
|
|
|
|
</ul>
|
2019-12-20 12:38:13 +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 page"
|
|
|
|
[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]="getSelectedPages().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
|
|
|
|
title="Select at least one page">
|
|
|
|
<li *ngIf="!isPortalAdministrator"><a [class]="getSelectedPages().length == 0 ? 'uk-disabled' : ''"
|
|
|
|
(click)="togglePages(true, getSelectedPages())"> Activate
|
|
|
|
</a></li>
|
|
|
|
<li *ngIf="!isPortalAdministrator"><a [class]="getSelectedPages().length == 0 ? 'uk-disabled' : ''"
|
|
|
|
(click)="togglePages(false, getSelectedPages())"> Deactivate
|
|
|
|
</a></li>
|
|
|
|
<li *ngIf="isPortalAdministrator"><a (click)="confirmDeleteSelectedPages()"> Delete </a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-01-12 11:23:26 +01:00
|
|
|
<div *ngIf="isPortalAdministrator">
|
2021-01-11 19:33:24 +01:00
|
|
|
<a (click)="newPage()"
|
|
|
|
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 page</button>
|
|
|
|
</a>
|
|
|
|
</div>
|
2021-01-11 10:21:42 +01:00
|
|
|
</div>
|
2019-12-20 12:38:13 +01:00
|
|
|
</div>
|
2021-01-11 19:33:24 +01:00
|
|
|
</div>
|
|
|
|
<div inner>
|
|
|
|
<div class="contentPanel ">
|
|
|
|
<div *ngIf="!isPortalAdministrator" class="uk-alert uk-alert-primary uk-margin-top-large">
|
|
|
|
<div>
|
|
|
|
<span class="uk-margin-small-right uk-icon" uk-icon="warning"></span>
|
|
|
|
Disable a page to hide it from community dashboard portal.
|
2021-01-11 10:21:42 +01:00
|
|
|
</div>
|
2021-01-11 19:33:24 +01:00
|
|
|
<div
|
|
|
|
class="uk-text-small">If the page is disabled, a message "Can't find that page" will appear in case the url
|
|
|
|
of that page is loaded. If the disabled page belongs to the menu, the link will be removed from menu, too.
|
2021-01-11 10:21:42 +01:00
|
|
|
</div>
|
2021-01-11 19:33:24 +01:00
|
|
|
|
|
|
|
</div>
|
|
|
|
<div *ngIf="updateErrorMessage" class="uk-alert-danger" uk-alert>
|
|
|
|
<a class="uk-alert-close" uk-close></a>
|
|
|
|
{{updateErrorMessage}}
|
|
|
|
</div>
|
|
|
|
<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
|
2021-01-11 10:21:42 +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">
|
|
|
|
<ul class="uk-list pages">
|
|
|
|
<li *ngFor="let check of checkboxes; let i=index" class="uk-card uk-card-default uk-margin-bottom">
|
|
|
|
<div class="uk-grid uk-padding">
|
2021-01-11 10:21:42 +01:00
|
|
|
<div class=""><input id="{{check.page._id}}" class="checkBox" type="checkbox"
|
2021-01-11 19:33:24 +01:00
|
|
|
name="pagescb[]" value="{{check.page._id}}" [(ngModel)]="check.checked">
|
2021-01-11 10:21:42 +01:00
|
|
|
</div>
|
2021-01-11 19:33:24 +01:00
|
|
|
<div class="uk-width-expand">
|
2021-01-11 10:21:42 +01:00
|
|
|
<div class="title uk-margin-medium-bottom">Name</div>
|
|
|
|
<div class="name uk-margin-medium-bottom" href="#">{{check.page.name}}</div>
|
|
|
|
<div *ngIf="check.page.entities && check.page.entities.length > 0"><span
|
2021-01-11 19:33:24 +01:00
|
|
|
class="title">Entities: </span>
|
2021-01-11 10:21:42 +01:00
|
|
|
{{check.page.entities.join(", ")}}</div>
|
|
|
|
<div class=" uk-margin-small-bottom"><span class="title">Route: </span> {{check.page.route}}</div>
|
2021-01-11 19:33:24 +01:00
|
|
|
<div *ngIf="!pagesType" class=" uk-margin-small-bottom"><span
|
|
|
|
class="title">Type: </span> {{check.page.type}}</div>
|
2021-01-11 10:21:42 +01:00
|
|
|
<div *ngIf="!selectedCommunityPid" class=" uk-margin-small-bottom">
|
2021-01-11 19:33:24 +01:00
|
|
|
<span class="title">Portal type: </span>{{check.page.portalType}}
|
2021-01-11 10:21:42 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div *ngIf="isPortalAdministrator" class="uk-width-1-4">
|
|
|
|
<div class="title uk-margin-medium-bottom">Actions</div>
|
|
|
|
<div class="actions" href="#">
|
|
|
|
<i class="clickable " (click)="editPage(i)" uk-icon="pencil"></i>
|
|
|
|
<i class="clickable uk-text-danger"
|
|
|
|
(click)="confirmDeletePage(check.page._id)" uk-icon="trash"></i>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div *ngIf="!isPortalAdministrator" class="uk-width-1-4">
|
|
|
|
<div class="title uk-margin-medium-bottom">Helptexts</div>
|
|
|
|
<div class=" uk-margin-small-bottom">
|
2019-12-20 12:38:13 +01:00
|
|
|
<a *ngIf="check.page.top || check.page.bottom || check.page.left || check.page.right"
|
|
|
|
class="helpContents"
|
|
|
|
[queryParams]="{communityId: selectedCommunityPid, pageId: check.page._id}"
|
2020-12-18 16:09:38 +01:00
|
|
|
routerLink="../../helptexts">
|
2021-01-11 10:21:42 +01:00
|
|
|
manage help texts
|
2019-12-20 12:38:13 +01:00
|
|
|
</a>
|
2021-01-11 10:21:42 +01:00
|
|
|
</div>
|
|
|
|
<div>
|
2019-12-20 12:38:13 +01:00
|
|
|
<a *ngIf="pageWithDivIds.includes(check.page._id)" class="classHelpContents"
|
2021-01-11 19:33:24 +01:00
|
|
|
[queryParams]="{communityId: selectedCommunityPid, pageId: check.page._id}"
|
|
|
|
routerLink="../../classContents">manage class contents</a>
|
2021-01-11 10:21:42 +01:00
|
|
|
</div>
|
2019-12-20 12:38:13 +01:00
|
|
|
</div>
|
2021-01-11 10:21:42 +01:00
|
|
|
<div *ngIf="!isPortalAdministrator" class="uk-width-1-4">
|
|
|
|
<div class="title uk-margin-medium-bottom">Enable/disable</div>
|
|
|
|
<mat-slide-toggle [checked]="check.page.isEnabled"
|
|
|
|
(change)="($event.source.checked = check.page.isEnabled);togglePages(!check.page.isEnabled,[check.page._id])"></mat-slide-toggle>
|
|
|
|
</div>
|
2019-12-20 12:38:13 +01:00
|
|
|
</div>
|
2021-01-11 19:33:24 +01:00
|
|
|
</li>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<div *ngIf="checkboxes.length==0" class="col-md-12">
|
|
|
|
<div class="uk-alert-warning" uk-alert>No pages found</div>
|
|
|
|
</div>
|
|
|
|
<div *ngIf="isPortalAdministrator" class="uk-width-1-1 uk-flex uk-flex-center ">
|
|
|
|
<div class="uk-width-small uk-button uk-button-default" (click)="newPage()">
|
|
|
|
<i class="" uk-icon="plus"></i>
|
2019-12-20 12:38:13 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2021-01-11 19:33:24 +01:00
|
|
|
<modal-alert #AlertModalSavePage (alertOutput)="pageSaveConfirmed($event)"
|
|
|
|
[okDisabled]="myForm && (myForm.invalid || !myForm.dirty)">
|
2019-12-20 12:38:13 +01:00
|
|
|
<div *ngIf="modalErrorMessage" class="uk-alert-danger" uk-alert aria-hidden="true">{{ modalErrorMessage }}</div>
|
|
|
|
<form [formGroup]="myForm">
|
|
|
|
|
|
|
|
<div dashboard-input class="uk-margin-small-left" [formInput]="myForm.get('route')"
|
|
|
|
type="text"
|
|
|
|
label="Page route">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div dashboard-input class="uk-margin-small-left" [formInput]="myForm.get('name')"
|
|
|
|
type="text"
|
|
|
|
label="Page Name">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div dashboard-input class="uk-margin-small-left" [formInput]="myForm.get('type')"
|
|
|
|
type="select"
|
|
|
|
label="Type" [options]="typeOptions">
|
|
|
|
</div>
|
|
|
|
<mat-form-field class="example-chip-list uk-width-1-1 uk-margin-small-left">
|
|
|
|
<mat-chip-list #chipList aria-label="Page selection">
|
|
|
|
<mat-chip
|
2021-01-11 19:33:24 +01:00
|
|
|
*ngFor="let entity of selectedEntities"
|
|
|
|
[selectable]="true"
|
|
|
|
[removable]="true">
|
2019-12-20 12:38:13 +01:00
|
|
|
{{entity.name}}
|
|
|
|
<span (click)="remove(entity)"
|
2021-01-11 10:21:42 +01:00
|
|
|
class=" notranslate mat-chip-remove mat-chip-trailing-icon " uk-icon="trash"></span>
|
2019-12-20 12:38:13 +01:00
|
|
|
</mat-chip>
|
|
|
|
<input placeholder="Add in pages..." #PageInput
|
|
|
|
[formControl]="entitiesSearchCtrl" [matAutocomplete]="auto" [matChipInputFor]="chipList">
|
|
|
|
</mat-chip-list>
|
|
|
|
<mat-autocomplete #auto="matAutocomplete" (optionSelected)="selected($event)">
|
|
|
|
<mat-option *ngFor="let entity of filteredEntities| async" [value]="entity">
|
|
|
|
{{entity.name}}
|
|
|
|
</mat-option>
|
|
|
|
</mat-autocomplete>
|
|
|
|
</mat-form-field>
|
|
|
|
|
2021-01-11 19:33:24 +01:00
|
|
|
<div class="form-group">
|
2019-12-20 12:38:13 +01:00
|
|
|
<label class="uk-text-danger uk-margin-small-bottom">
|
|
|
|
By disabling a position, all contents in this position will be deleted.
|
|
|
|
</label>
|
2021-01-11 10:21:42 +01:00
|
|
|
<div class="title"> Select if this page exists in:</div>
|
2020-12-18 16:09:38 +01:00
|
|
|
<div class=" uk-grid">
|
|
|
|
<span dashboard-input class="" [formInput]="myForm.get('top')"
|
|
|
|
type="checkbox"
|
2021-01-11 19:33:24 +01:00
|
|
|
label="Top">
|
2020-12-18 16:09:38 +01:00
|
|
|
</span>
|
|
|
|
<span dashboard-input class="uk-margin-small-left" [formInput]="myForm.get('right')"
|
|
|
|
type="checkbox"
|
|
|
|
label="Right">
|
|
|
|
</span>
|
|
|
|
<span dashboard-input class="uk-margin-small-left" [formInput]="myForm.get('bottom')"
|
|
|
|
type="checkbox"
|
|
|
|
label="Bottom">
|
|
|
|
</span>
|
|
|
|
<span dashboard-input class="uk-margin-small-left" [formInput]="myForm.get('left')"
|
|
|
|
type="checkbox"
|
|
|
|
label="Left">
|
|
|
|
</span>
|
|
|
|
</div>
|
2019-12-20 12:38:13 +01:00
|
|
|
</div>
|
2021-01-11 19:33:24 +01:00
|
|
|
<div [ngClass]="{'has-error':!myForm.controls.portalType.valid && myForm.controls.portalType.dirty}"
|
|
|
|
class="form-group">
|
2021-01-11 10:21:42 +01:00
|
|
|
<div class="uk-width-1-1 uk-margin-small-bottom uk-text-bold uk-form-label">
|
2020-09-24 13:18:24 +02:00
|
|
|
Page exists in:
|
2020-10-30 15:01:44 +01:00
|
|
|
</div>
|
2020-12-18 16:09:38 +01:00
|
|
|
<div class="uk-child-width-1-2 uk-grid">
|
|
|
|
<span *ngFor="let option of portalUtils.portalTypes" class="radio ">
|
|
|
|
<span class="uk-margin-small-right" style="font-weight: normal;">{{option.label}}</span>
|
|
|
|
<input type="radio" [value]="option.value" formControlName="portalType">
|
|
|
|
</span>
|
|
|
|
</div>
|
2019-12-20 12:38:13 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<input type="hidden" formControlName="_id">
|
|
|
|
</form>
|
|
|
|
|
|
|
|
</modal-alert>
|
|
|
|
|
|
|
|
<modal-alert #AlertModalDeletePages (alertOutput)="confirmedDeletePages($event)"></modal-alert>
|