167 lines
8.7 KiB
HTML
167 lines
8.7 KiB
HTML
<div id="page_content" click-outside-or-esc targetId="page_content">
|
|
<div class="uk-padding-small md-bg-white" uk-grid>
|
|
<div *ngIf="!selectedPageId" class="filters marginBottom20">
|
|
<div dashboard-input label="Filter by page" [formInput]="selectForm" type="select"
|
|
[options]="selectOptions"></div>
|
|
</div>
|
|
<div class="uk-width-expand@m uk-width-1-1 uk-flex uk-flex-middle uk-flex-right">
|
|
<div class="uk-inline uk-width-medium">
|
|
<span class="uk-position-center-right"><i class="material-icons">search</i></span>
|
|
<div dashboard-input [formInput]="filterForm" label="Find help text"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="page_content_inner">
|
|
<div>
|
|
|
|
<div *ngIf="!errorMessage && !showLoading" class="page-controls">
|
|
|
|
|
|
<button class="uk-button uk-button-primary uk-float-right" type="button">Bulk Actions</button>
|
|
<div uk-dropdown="mode: click">
|
|
<ul class="uk-nav uk-navbar-dropdown-nav uk-margin-left"
|
|
[attr.uk-tooltip]="getSelectedPageHelpContents().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
|
|
title="Select at least one help text">
|
|
<li><a [class]="getSelectedPageHelpContents().length == 0 ? 'uk-disabled' : ''"
|
|
(click)="togglePageHelpContents(true,getSelectedPageHelpContents())"><i></i> Activate </a></li>
|
|
<li><a [class]="getSelectedPageHelpContents().length == 0 ? 'uk-disabled' : ''"
|
|
(click)="togglePageHelpContents(false,getSelectedPageHelpContents())"><i></i> Deactivate </a>
|
|
</li>
|
|
<li><a [class]="getSelectedPageHelpContents().length == 0 ? 'uk-disabled' : ''"
|
|
(click)="confirmDeleteSelectedPageHelpContents()"><i></i> Delete </a></li>
|
|
</ul>
|
|
|
|
</div>
|
|
<h4 class="uk-text-bold">
|
|
<span *ngIf="!selectedPageId">Page help texts</span>
|
|
<span *ngIf="selectedPageId && page">Page help texts of page '{{page.name}}' </span>
|
|
</h4>
|
|
</div>
|
|
</div>
|
|
<div *ngIf="updateErrorMessage" class="uk-alert-danger" uk-alert>
|
|
<a class="uk-alert-close" uk-close></a>
|
|
{{updateErrorMessage}}
|
|
</div>
|
|
|
|
|
|
<div class="content-wrapper" id="contentWrapper">
|
|
<div>
|
|
<div class="contentPanel">
|
|
<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
|
|
class="uk-align-center loading-gif"></div>
|
|
|
|
|
|
<div *ngIf="!errorMessage && !showLoading">
|
|
<div class="uk-alert uk-alert-primary uk-margin-top-large">
|
|
<span class="uk-margin-small-right uk-icon" uk-icon="info"></span>
|
|
Enable or disable help text to show or hide it from the dashboard
|
|
|
|
</div>
|
|
<ul uk-tab class="links">
|
|
<li [ngClass]="{'uk-active' : filters.active==null}" (click)="displayAllPageHelpContents()">
|
|
<a>All help texts <span class="uk-badge">{{counter.all | number}}</span></a>
|
|
</li>
|
|
<li [ngClass]="{'uk-active' : filters.active==true}" (click)="displayActivePageHelpContents()">
|
|
<a>Active <span class="uk-badge">{{counter.active | number}}</span></a>
|
|
</li>
|
|
<li [ngClass]="{'uk-active' : filters.active==false}" (click)="displayInactivePageHelpContents()">
|
|
<a>Inactive <span class="uk-badge">{{counter.inactive | number}}</span></a>
|
|
</li>
|
|
</ul>
|
|
<div class="md-card uk-margin-medium-bottom" *ngIf="!errorMessage && !showLoading">
|
|
<div class="md-card-content">
|
|
<div class="uk-overflow-container">
|
|
<table class="uk-table uk-table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th><input id="allPageHelpContentsCheckbox" type="checkbox" (change)="toggleCheckBoxes($event)">
|
|
</th>
|
|
<th *ngIf="!selectedPageId">Page</th>
|
|
<th *ngIf="!selectedPageId">Community</th>
|
|
<th>Content</th>
|
|
<th>Placement</th>
|
|
<th>Order</th>
|
|
<!--<th>Before</th>-->
|
|
<th>Change status</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr *ngFor="let check of checkboxes; let i=index">
|
|
<td><input id="{{check.pageHelpContent._id}}" class="checkBox" type="checkbox"
|
|
name="entitiescb[]" value="{{check.pageHelpContent._id}}" [(ngModel)]="check.checked">
|
|
</td>
|
|
<td *ngIf="!selectedPageId">
|
|
<div class="page" href="#">{{check.pageHelpContent.page.name}}</div>
|
|
</td>
|
|
<td *ngIf="!selectedPageId">
|
|
<div class="community" href="#">{{check.pageHelpContent.community.name}}</div>
|
|
</td>
|
|
<td>
|
|
<!-- <div class="content" [innerHtml]="check.pageHelpContent.content | safeHtml"></div>-->
|
|
<div class="content">{{check.pageHelpContent.content}}</div>
|
|
</td>
|
|
<td>
|
|
<div class="placement" href="#">{{check.pageHelpContent.placement}}</div>
|
|
</td>
|
|
<td>
|
|
<div class="order" href="#">{{check.pageHelpContent.order}}
|
|
</div>
|
|
</td>
|
|
<!--<td>
|
|
<div class="isPriorTo" href="#">{{check.pageHelpContent.isPriorTo}}
|
|
</div>
|
|
</td>-->
|
|
<td>
|
|
<mat-slide-toggle [checked]="check.pageHelpContent.isActive"
|
|
(change)="($event.source.checked = check.pageHelpContent.isActive);togglePageHelpContents(!check.pageHelpContent.isActive,[check.pageHelpContent._id])"></mat-slide-toggle>
|
|
</td>
|
|
<td>
|
|
<!-- <div class="actions" href="#">-->
|
|
<!-- <input title="Edit" src="assets/imgs/icn_edit.png" class="edit uk-margin-small-right" type="image" (click)="editPageHelpContent(check.pageHelpContent._id)">-->
|
|
<!-- <input title="Delete" src="assets/imgs/icn_trash.png" class="delete" type="image" (click)="confirmDeletePageHelpContent(check.pageHelpContent._id)">-->
|
|
<!-- </div>-->
|
|
|
|
<div class="actions" href="#">
|
|
<i class="md-icon material-icons"
|
|
(click)="editPageHelpContent(check.pageHelpContent._id)"></i>
|
|
<i class="material-icons md-icon"
|
|
(click)="confirmDeletePageHelpContent(check.pageHelpContent._id)">delete</i>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<div *ngIf="checkboxes.length==0" class="col-md-12">
|
|
<div class="uk-alert-warning" uk-alert>No page contents found</div>
|
|
</div>
|
|
<div class="uk-width-1-1 uk-flex uk-flex-center ">
|
|
<div class="uk-width-small uk-flex uk-flex-center uk-button" (click)="newPageContent()">
|
|
<i class="material-icons md-48">add</i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<a *ngIf="selectedPageId && page" [queryParams]="{type: page.type, communityId: selectedCommunityPid}"
|
|
routerLink="/pages">Go back to {{page.type}} pages</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- <fab (clicked)="newPageContent()"></fab>-->
|
|
</div>
|
|
|
|
<!-- <delete-confirmation-dialog #deleteConfirmationModal [isModalShown]="isModalShown" (emmitObject)="confirmedDeletePageHelpContents($event)">
|
|
Are you sure you want to delete the selected page content(s)?
|
|
</delete-confirmation-dialog> -->
|
|
<modal-alert #AlertModalDeletePageHelpContents (alertOutput)="confirmedDeletePageHelpContents($event)"></modal-alert>
|