<!-- <div id="pageContents">
    <div id="content">
        <div class="menubar fixed">
            <div class="sidebar-toggler visible-xs">
                <i class="ion-navicon"></i>
            </div>

            <div class="page-title">Page Help Contents</div>
            <form class="search">
                <input #inputstring (keyup.enter)="filterBySearch(inputstring.value)" placeholder="Search page content (content)..." type="text"/>
                <input class="btn" type="submit">
            </form>
            <a *ngIf="!selectedPageId" [queryParams]="{communityId: selectedCommunityId}" routerLink="/pageContents/new" class="btn btn-success pull-right"><i></i> New Page Content </a>
            <a *ngIf="selectedPageId" [queryParams]="{communityId: selectedCommunityId, pageId: selectedPageId}" routerLink="/pageContents/new" class="btn btn-success pull-right"><i></i> New Page Content </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 *ngIf="!selectedPageId" class="col-md-12 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 *ngIf="!selectedPageId" class="col-md-12 filters marginBottom20">
                          <div class="links form-group form-inline">
                              <div class="gwt-Label filterLabel">Filter by page:</div>
                              <select class="input-xxlarge form-control" (change)="filterByPage($event)">
                                  <option value="">-- none selected --</option>
                                  <option *ngFor="let page of pages" value="{{page._id}}">{{page.name}}</option>
                              </select>
                          </div>
                        </div>
                        <div class="col-md-12 filters">
                            <div class="links">
                                <div class="gwt-Label filterLabel">Filter page contents:</div>
                                <a [ngClass]="{'active' : filters.active==null}" (click)="displayAllPageHelpContents()">
                                    All Page Contents ({{counter.all}})
                                </a>
                                <a [ngClass]="{'active' : filters.active==true}" (click)="displayActivePageHelpContents()">
                                    Active ({{counter.active}})
                                </a>
                                <a [ngClass]="{'active' : filters.active==false}" (click)="displayInactivePageHelpContents()">
                                    Inactive ({{counter.inactive}})
                                </a>
                            </div>
                            <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)="togglePageHelpContents(true,getSelectedPageHelpContents())"><i></i> Activate </a></li>
                                        <li><a (click)="togglePageHelpContents(false,getSelectedPageHelpContents())"><i></i> Deactivate </a></li>
                                        <li><a (click)="confirmDeleteSelectedPageHelpContents()"><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="row headers">
                                        <div class="col-sm-1 header select-users"><input id="allPageHelpContentsCheckbox" [checked]="checkboxAll" type="checkbox" (change)="toggleCheckBoxes($event)">
                                        </div>
                                        <div class="col-sm-2 header hidden-xs"><label><a href="#">Page</a></label></div>
                                        <div class="col-sm-1 header hidden-xs"><label><a href="#">Community</a></label></div>
                                        <div class="col-sm-1 header hidden-xs"><label><a href="#">Placement</a></label></div>
                                        <div class="col-sm-1 header hidden-xs"><label><a href="#">Order</a></label></div>
                                        <div class="col-sm-1 header hidden-xs"><label><a href="#">Active</a></label></div>
                                        <div class="col-sm-4 header hidden-xs"><label><a href="#">Content</a></label></div>
                                        <div class="col-sm-1 header hidden-xs"><label><a href="#">Actions</a></label></div>
                                    </div>

                                    <ng-template [ngIf]="checkboxes && checkboxes.length>0">
                                        <div *ngFor="let check of checkboxes; let i=index" class="row user">
                                            <div class="col-sm-1 avatar"><input id="{{check.pageHelpContent._id}}" class="checkBox" type="checkbox"
                                                                                name="pageHelpContentscb[]" value="{{check.pageHelpContent._id}}" [(ngModel)]="check.checked">
                                            </div>
                                            <div class="col-sm-2">
                                                <div class="page" href="#">{{check.pageHelpContent.page.name}}</div>
                                            </div>
                                            <div class="col-sm-1">
                                                <div class="community" href="#">{{check.pageHelpContent.community.name}}</div>
                                            </div>
                                            <div class="col-sm-1">
                                                <div class="placement" href="#">{{check.pageHelpContent.placement}}</div>
                                            </div>
                                            <div class="col-sm-1">
                                                <div class="order" href="#">{{check.pageHelpContent.order}}
                                                </div>
                                            </div>
                                            <div class="col-sm-1">
                                                <div *ngIf="check.pageHelpContent.isActive" class="activated" >
                                                    <input (click)="togglePageHelpContents(false,[check.pageHelpContent._id])" class="deactivate" src="imgs/check-icon.png" title="Deactivate" width="20" type="image" height="20">
                                                </div>
                                                <div *ngIf="!check.pageHelpContent.isActive" class="deactivated" >
                                                    <input (click)="togglePageHelpContents(true,[check.pageHelpContent._id])" class="activate" src="imgs/x-icon.png" title="Activate" width="20" type="image" height="20">
                                                </div>
                                            </div>
                                            <div class="col-sm-4">
                                                <div class="content" href="#">{{check.pageHelpContent.content}}
                                                </div>
                                            </div>
                                            <div class="col-sm-1">
                                                <div class="actions" href="#">
                                                    <input title="Edit" src="imgs/icn_edit.png" class="edit" type="image" (click)="editPageHelpContent(check.pageHelpContent._id)">
                                                    <input title="Delete" src="imgs/icn_trash.png" class="delete" type="image" (click)="confirmDeletePageHelpContent(check.pageHelpContent._id)">
                                                </div>
                                            </div>
                                        </div>
                                    </ng-template>
                                    <div *ngIf="checkboxes.length==0" class="col-md-12">
                                        <div class="alert alert-warning">No page contents found</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <a *ngIf="selectedPageId" [queryParams]="{type: pageType}" routerLink="/pages">Go back to {{pageType}} pages</a>
                </div>
            </div>
        </div>
    </div>
</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> -->


<div id="pageHelpContents" class="uk-container">

        <div class="menubar ">

            <div *ngIf="!selectedPageId" class="pageHelpContent-title uk-article-title">Page Help Contents</div>
            <div *ngIf="selectedPageId && page && community" class="pageHelpContent-title uk-article-title">'{{page.name}}' Help Contents of community {{community.name}}</div>

            <form target="BSFormPanel_Admin_1" class="search">
                <input #inputstring (keyup.enter)="filterBySearch(inputstring.value)" placeholder="Page Help Content..." type="text" class="uk-input uk-width-medium"/>
                <button class="uk-button" type="submit">Search</button>
            </form>
            <a *ngIf="!selectedPageId" [queryParams]="{community: selectedCommunityPid}" routerLink="/pageContents/new" class="uk-button uk-button-primary uk-float-right"><i></i> New Page Content </a>
            <a *ngIf="selectedPageId" [queryParams]="{community: selectedCommunityPid, pageId: selectedPageId}" routerLink="/pageContents/new" class="uk-button uk-button-primary uk-float-right"><i></i> New Page Content </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)="togglePageHelpContents(true,getSelectedPageHelpContents())"><i></i> Activate </a></li>
                                    <li><a (click)="togglePageHelpContents(false,getSelectedPageHelpContents())"><i></i> Deactivate </a></li>
                                    <li><a (click)="confirmDeleteSelectedPageHelpContents()"><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 *ngIf="!selectedPageId" 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>
                                  <div *ngIf="!selectedPageId" class="filters marginBottom20">
                                      <div class="links form-group form-inline">
                                          <span>Filter by page:</span>
                                          <select class="uk-select uk-width-medium" (change)="filterByPage($event)">
                                              <option value="">-- none selected --</option>
                                              <option *ngFor="let page of pages" value="{{page._id}}">{{page.name}}</option>
                                          </select>
                                      </div>
                                  </div>

                                  <span class="gwt-Label filterLabel">Filter page contents:</span>
                                  <ul uk-tab class="links">
                                      <li [ngClass]="{'uk-active' : filters.active==null}" (click)="displayAllPageHelpContents()">
                                          <a>All Page Contents <span class="uk-badge">{{counter.all}}</span></a>
                                      </li>
                                      <li [ngClass]="{'uk-active' : filters.active==true}" (click)="displayActivePageHelpContents()">
                                          <a>Active <span class="uk-badge">{{counter.active}}</span></a>
                                      </li>
                                      <li [ngClass]="{'uk-active' : filters.active==false}" (click)="displayInactivePageHelpContents()">
                                          <a>Inactive <span class="uk-badge">{{counter.inactive}}</span></a>
                                      </li>
                                  </ul>

                                  <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>Active</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" href="#" [innerHtml]="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>
                                                <div *ngIf="check.pageHelpContent.isActive" class="activated" >
                                                    <input (click)="togglePageHelpContents(false,[check.pageHelpContent._id])" class="deactivate" src="imgs/check-icon.png" title="Deactivate" width="20" type="image" height="20">
                                                </div>
                                                <div *ngIf="!check.pageHelpContent.isActive" class="deactivated" >
                                                    <input (click)="togglePageHelpContents(true,[check.pageHelpContent._id])" class="activate" src="imgs/x-icon.png" title="Activate" width="20" type="image" height="20">
                                                </div>
                                            </td>
                                            <td>
                                                <div class="actions" href="#">
                                                    <input title="Edit" src="imgs/icn_edit.png" class="edit" type="image" (click)="editPageHelpContent(check.pageHelpContent._id)">
                                                    <input title="Delete" src="imgs/icn_trash.png" class="delete" type="image" (click)="confirmDeletePageHelpContent(check.pageHelpContent._id)">
                                                </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>
                            </div>
                        </div>
                        <a *ngIf="selectedPageId && page" [queryParams]="{type: page.type}" routerLink="/pages">Go back to {{page.type}} pages</a>
                    </div>
                </div>
            </div>
        </div>
</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>
