connect-admin/src/app/pages/page/pages.component.html

161 lines
12 KiB
HTML

<div id="pages">
<div class="menubar ">
<div class="page-title uk-text-large">{{capitalizeFirstLetter(pagesType)}} Pages</div>
<div *ngIf="updateErrorMessage" class="uk-alert-danger" uk-alert>
<a class="uk-alert-close" uk-close></a>
{{updateErrorMessage}}
</div>
<div *ngIf="!errorMessage && !showLoading" class="page-controls">
<div class=" filters ">
<div class="show-options uk-float-right">
<button class="uk-button" type="button">Bulk Actions</button>
<div uk-dropdown="mode: click">
<ul class="uk-nav uk-nav-dropdown"
[attr.uk-tooltip]="getSelectedPages().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one page">
<li><a [class]="getSelectedPages().length == 0 ? 'uk-disabled' : ''" (click)="togglePages(true, getSelectedPages())"><i></i> Activate </a></li>
<li><a [class]="getSelectedPages().length == 0 ? 'uk-disabled' : ''" (click)="togglePages(false, getSelectedPages())"><i></i> Deactivate </a></li>
<li *ngIf="isPortalAdministrator"><a (click)="confirmDeleteSelectedPages()"><i></i> Delete </a></li>
</ul>
</div>
</div>
</div>
</div>
<!-- <a *ngIf="isPortalAdministrator" (click)="showModal()" class="uk-button uk-button-primary uk-float-right"><i></i> New Page </a> -->
<form target="BSFormPanel_Admin_1" class="search">
<input #inputstring (keyup.enter)="filterBySearch(inputstring.value)" placeholder="Page name..." type="text" class="uk-input uk-width-medium"/>
<button class="uk-button" type="submit">Search</button>
</form>
</div>
<div class="content-wrapper" id="contentWrapper">
<div>
<div class="contentPanel uk-margin-top">
<div 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. </div>
<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. </div>
</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 class="uk-align-center loading-gif"></div>
<div *ngIf="!errorMessage && !showLoading">
<div class="gwt-HTML">
<div class="users-list"> <!--"row" class removed"-->
<div class="col-md-12">
<!-- <div class="filters marginBottom20">
<div class="links form-group form-inline">
<span>Filter by community:</span>
<select class="uk-select uk-width-medium" (change)="filterByCommunity($event)">
<option *ngFor="let community of communities" value="{{community.pid}}">{{community.name}}</option>
</select>
</div>
</div> -->
<table class="uk-table uk-table-striped">
<thead>
<tr>
<th><input id="allPageCheckbox" type="checkbox" (change)="toggleCheckBoxes($event)"></th>
<th>Name</th>
<th>Change status</th>
<th *ngIf="!pagesType">Type</th>
<th>Related Entities</th>
<th>Route</th>
<th *ngIf="isPortalAdministrator" >Actions</th>
<th *ngIf="!pagesType || (pagesType!='other' && pagesType!='html')" class="uk-text-center">Page help texts</th>
<th *ngIf="pageWithDivIds && pageWithDivIds.length > 0" class="uk-text-center">Class help texts</th>
<th *ngIf="!pagesType || pagesType=='html'" class="uk-text-center">Html Content</th>
</tr>
</thead>
<tbody >
<tr *ngFor="let check of checkboxes; let i=index">
<td><input id="{{check.page._id}}" class="checkBox" type="checkbox"
name="pagescb[]" value="{{check.page._id}}" [(ngModel)]="check.checked">
</td>
<td>
<div class="name" href="#">{{check.page.name}}</div>
</td>
<td>
<div *ngIf="check.page.isEnabled" class="activated" >
<input (click)="togglePages(false,[check.page._id])" class="deactivate" src="assets/imgs/check-icon.png" title="Disable" width="20" type="image" height="20">
</div>
<div *ngIf="!check.page.isEnabled" class="deactivated" >
<input (click)="togglePages(true,[check.page._id])" class="deactivate" src="assets/imgs/x-icon.png" title="Enable" width="20" type="image" height="20">
</div>
</td>
<td *ngIf="!pagesType">
<div class="type" href="#">{{check.page.type}}</div>
</td>
<td>
<div class="entities" href="#">
<span *ngFor="let entity of check.page.entities let i=index">{{entity.name}}<span *ngIf="i<(check.page.entities.length-1)">, </span></span>
</div>
</td>
<td>
<div class="route" href="#">{{check.page.route}}</div>
</td>
<td *ngIf="isPortalAdministrator" >
<div class="actions" href="#">
<input title="Edit" src="assets/imgs/icn_edit.png" class="edit" type="image" (click)="editPage(i)">
<input title="Delete" src="assets/imgs/icn_trash.png" class="delete" type="image" (click)="confirmDeletePage(check.page._id)">
</div>
</td>
<td *ngIf="!pagesType || (pagesType!='other' && pagesType!='html')" class="uk-text-center">
<a *ngIf="check.page.type != 'html' && check.page.type != 'other'" class="helpContents" [queryParams]="{communityId: selectedCommunityPid, pageId: check.page._id}" routerLink="/pageContents">add page contents</a>
<span *ngIf="check.page.type == 'html' || check.page.type == 'other'">-</span>
</td>
<td *ngIf="pageWithDivIds && pageWithDivIds.length > 0" class="uk-text-center">
<a *ngIf="pageWithDivIds.includes(check.page._id)" class="classHelpContents" [queryParams]="{communityId: selectedCommunityPid, pageId: check.page._id}" routerLink="/classContents">add class contents</a>
<span *ngIf="!pageWithDivIds.includes(check.page._id)">-</span>
</td>
<td *ngIf="!pagesType || pagesType=='html'" class="uk-text-center">
<a *ngIf="check.page.type == 'html'" class="htmlContents" [queryParams]="{communityId: selectedCommunityPid, pageId: check.page._id}" routerLink="/htmlPageContent/edit">edit html contents</a>
<span *ngIf="check.page.type != 'html'">-</span>
</td>
</tr>
</tbody>
</table>
<div *ngIf="checkboxes.length==0" class="col-md-12">
<div class="uk-alert-warning" uk-alert>No pages found</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- <fab *ngIf="isPortalAdministrator" (clicked)="showModal()"></fab> -->
<fab *ngIf="isPortalAdministrator" (clicked)="newPage()"></fab>
</div>
<!-- <modal-form #saveModal [saveText]="'Save'" [titleText]="'Add a new Page'" [formGroup]="formGroup" [type]="'page'"
[isModalShown]="isModalShown" (emmitObject)="pageSavedSuccessfully($event)" (emmitError)="handleUpdateError($event)">
<page-form [group]="formGroup"></page-form>
</modal-form> -->
<!--<modal-form #updateModal [saveText]="'Update'" [titleText]="'Update Page'" [formGroup]="formGroup" [type]="'page'"
[isModalShown]="isModalShown" (emmitObject)="pageUpdatedSuccessfully($event)" (emmitError)="handleUpdateError($event)">
<page-form [group]="formGroup"></page-form>
</modal-form> -->
<modal-alert #AlertModalSavePage (alertOutput)="pageSaveConfirmed($event)">
<div *ngIf="modalErrorMessage" class="uk-alert-danger" uk-alert aria-hidden="true">{{ modalErrorMessage }}</div>
<page-form [group]="formGroup"></page-form>
</modal-alert>
<modal-alert #AlertModalUpdatePage (alertOutput)="pageUpdateConfirmed($event)">
<div *ngIf="modalErrorMessage" class="uk-alert-danger" uk-alert aria-hidden="true">{{ modalErrorMessage }}</div>
<page-form [group]="formGroup"></page-form>
</modal-alert>
<!-- <delete-confirmation-dialog #deleteConfirmationModal [isModalShown]="isModalShown" (emmitObject)="confirmedDeletePages($event)">
Are you sure you want to delete the selected page(s)?
</delete-confirmation-dialog> -->
<modal-alert #AlertModalDeletePages (alertOutput)="confirmedDeletePages($event)"></modal-alert>