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

271 lines
18 KiB
HTML

<!-- <div id="pages">
<div id="content">
<div class="menubar fixed">
<div class="sidebar-toggler visible-xs">
<i class="ion-navicon"></i>
</div>
<div class="page-title">Pages</div>
<form target="BSFormPanel_Admin_1" class="search">
<input #inputstring (keyup.enter)="filterBySearch(inputstring.value)" placeholder="Search pages (route, name)..." type="text"/>
<input class="btn" type="submit">
</form>
<a (click)="showModal()" class="btn btn-success pull-right"><i></i> New Page </a>
</div>
<div class="content-wrapper" id="contentWrapper">
<div>
<div class="contentPanel">
<div class="alert alert-danger" style="display: none;" aria-hidden="true">
<span></span><span></span><span></span></div>
<div class="alert alert-success" style="display: none;" aria-hidden="true">
<span></span><span></span><span></span></div>
<div class="alert" style="display: none;" aria-hidden="true"><span></span><span></span><span></span></div>
<div class="row page-controls">
<div class="col-md-12 filters">
<div class="show-options">
<div class="btn-group"><a href="javascript:;" class="btn dropdown-toggle"
data-toggle="dropdown"><i></i> Bulk Actions <span
class="caret"></span></a>
<ul class="dropdown-menu">
<li><a (click)="confirmDeleteSelectedPages()"><i></i> Delete </a></li>
</ul>
</div>
</div>
</div>
</div>
<div>
<div class="gwt-HTML">
<div class="row users-list">
<div class="col-md-12">
<div class="filters marginBottom20">
<div class="links form-group form-inline">
<div class="gwt-Label filterLabel">Filter by community:</div>
<select class="input-xxlarge form-control" (change)="filterByCommunity($event)">
<option *ngFor="let community of communities" value="{{community._id}}">{{community.name}}</option>
</select>
</div>
</div>
<div class="row headers">
<div class="col-sm-1 header select-users"><input id="allPageCheckbox" type="checkbox" (change)="toggleCheckBoxes($event)">
</div>
<div class="col-sm-2 header hidden-xs"><label><a href="#">Route</a></label></div>
<div class="col-sm-2 header hidden-xs"><label><a href="#">Name</a></label></div>
<div class="col-sm-1 header hidden-xs"><label><a href="#">State</a></label></div>
<div class="col-sm-1 header hidden-xs"><label><a href="#">Type</a></label></div>
<div class="col-sm-3 header hidden-xs"><label><a href="#">Related Entities</a></label></div>
<div class="col-sm-1 header hidden-xs"><label><a href="#">Actions</a></label></div>
<div class="col-sm-1 header hidden-xs"><label><a href="#">Help Contents</a></label></div>
</div>
<ng-template [ngIf]="pagesCheckboxes && pagesCheckboxes.length>0">
<div *ngFor="let check of pagesCheckboxes; let i=index" class="row user">
<div class="col-sm-1 avatar"><input id="{{check.page._id}}" class="checkBox" type="checkbox"
name="pagescb[]" value="{{check.page._id}}" [(ngModel)]="check.checked">
</div>
<div class="col-sm-2">
<div class="route" href="#">{{check.page.route}}</div>
</div>
<div class="col-sm-2">
<div class="name" href="#">{{check.page.name}}</div>
</div>
<div class="col-sm-1">
<div *ngIf="check.page.isEnabled" class="activated" >
<input (click)="togglePage(false,[check.page._id])" class="deactivate" src="imgs/check-icon.png" title="Disable" width="20" type="image" height="20">
</div>
<div *ngIf="!check.page.isEnabled" class="deactivated" >
<input (click)="togglePage(true,[check.page._id])" class="deactivate" src="imgs/x-icon.png" title="Enable" width="20" type="image" height="20">
</div>
</div>
<div class="col-sm-1">
<div class="type" href="#">{{check.page.type}}</div>
</div>
<div class="col-sm-3">
<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>
</div>
<div class="col-sm-1">
<div class="actions" href="#">
<input title="Edit" src="imgs/icn_edit.png" class="edit" type="image" (click)="editPage(i)">
<input title="Delete" src="imgs/icn_trash.png" class="delete" type="image" (click)="confirmDeletePage(check.page._id)">
</div>
</div>
<div class=col-sm-1>
<a class="helpContents" [queryParams]="{community: selectedCommunityId, page: check.page._id}" routerLink="/pageContents">edit</a>
</div>
</div>
</ng-template>
<div *ngIf="pagesCheckboxes.length==0" class="col-md-12">
<div class="alert alert-warning">No pages found</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<modal-form #saveModal [saveText]="'Save'" [titleText]="'Add a new Page'" [formGroup]="formGroup" [type]="'page'"
[isModalShown]="isModalShown" (emmitObject)="pageSavedSuccessfully($event)" (emmitError)="handleError($event)"
[selectedCommunityId]="selectedCommunityId">
<page-form [group]="formGroup" [selectedCommunityId]="selectedCommunityId" [type]="pagesType"></page-form>
</modal-form>
<modal-form #updateModal [saveText]="'Update'" [titleText]="'Update Page'" [formGroup]="formGroup" [type]="'page'"
[isModalShown]="isModalShown" (emmitObject)="pageUpdatedSuccessfully($event)" (emmitError)="handleError($event)"
[selectedCommunityId]="selectedCommunityId">
<page-form [group]="formGroup" [selectedCommunityId]="selectedCommunityId" [type]="pagesType"></page-form>
</modal-form>
<delete-confirmation-dialog #deleteConfirmationModal [isModalShown]="isModalShown" (emmitObject)="confirmedDeletePages($event)">
Are you sure you want to delete the selected page(s)?
</delete-confirmation-dialog> -->
<div id="pages" class="uk-container">
<div class="menubar ">
<div class="page-title uk-article-title ">Pages</div>
<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>
<a (click)="showModal()" class="uk-button uk-button-primary uk-float-right"><i></i> New Page </a>
</div>
<div class="content-wrapper" id="contentWrapper">
<div>
<div class="contentPanel">
<div class="uk-alert-danger" uk-alert style="display: none;" aria-hidden="true">
<span></span><span></span><span></span></div>
<div class="uk-alert-success" uk-alert style="display: none;" aria-hidden="true">
<span></span><span></span><span></span></div>
<div class="uk-alert" uk-alert style="display: none;" aria-hidden="true"><span></span><span></span><span></span></div>
<div 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-dropdown-nav">
<li><a (click)="togglePages(true, getSelectedPages())"><i></i> Activate </a></li>
<li><a (click)="togglePages(false, getSelectedPages())"><i></i> Deactivate </a></li>
<li><a (click)="confirmDeleteSelectedPages()"><i></i> Delete </a></li>
</ul>
</div>
</div>
</div>
</div>
<div>
<div class="gwt-HTML">
<div class="row users-list">
<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 value="">-- none selected --</option-->
<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>State</th>
<th *ngIf="!pagesType">Type</th>
<th>Related Entities</th>
<th>Route</th>
<th>Actions</th>
<th>Page Help Contents</th>
<th *ngIf="pageWithDivIds && pageWithDivIds.length > 0">Class Help Contents</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="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="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>
<div class="actions" href="#">
<input title="Edit" src="imgs/icn_edit.png" class="edit" type="image" (click)="editPage(i)">
<input title="Delete" src="imgs/icn_trash.png" class="delete" type="image" (click)="confirmDeletePage(check.page._id)">
</div>
</td>
<td>
<a class="helpContents" [queryParams]="{community: selectedCommunityPid, page: check.page._id}" routerLink="/pageContents">add page contents</a>
</td>
<td *ngIf="pageWithDivIds && pageWithDivIds.length > 0" class="uk-text-center">
<a *ngIf="pageWithDivIds.includes(check.page._id)" class="classHelpContents" [queryParams]="{community: selectedCommunityPid, page: check.page._id}" routerLink="/classContents">add class contents</a>
<span *ngIf="!pageWithDivIds.includes(check.page._id)">-</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>
</div>
<modal-form #saveModal [saveText]="'Save'" [titleText]="'Add a new Page'" [formGroup]="formGroup" [type]="'page'"
[isModalShown]="isModalShown" (emmitObject)="pageSavedSuccessfully($event)" (emmitError)="handleError($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)="handleError($event)">
<page-form [group]="formGroup"></page-form>
</modal-form>
<delete-confirmation-dialog #deleteConfirmationModal [isModalShown]="isModalShown" (emmitObject)="confirmedDeletePages($event)">
Are you sure you want to delete the selected page(s)?
</delete-confirmation-dialog>