<div id="communities">
        <div class="menubar ">
            <div class="community-title uk-text-large">Communities</div>
            <div *ngIf="updateErrorMessage" class="uk-alert-danger" uk-alert>
              <a class="uk-alert-close" uk-close></a>
              {{updateErrorMessage}}
            </div>
            <form target="BSFormPanel_Admin_1" class="search">
                <!-- <input #inputstring (keyup.enter)="filterBySearch(inputstring.value)" placeholder="Community name..." type="text" class="uk-input uk-width-medium"/>
                <button class="uk-button" type="submit">Search</button> -->
                <input type="text" class="uk-input uk-width-medium" placeholder="Community name..." aria-describedby="sizing-addon2"  [(ngModel)]="keyword"  name="keyword" >
                <button (click)="filterBySearch(keyword)"  type="submit" class=" uk-button">
                   <span class="uk-icon">
                   <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="search" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="9" cy="9" r="7"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M14,14 L18,18 L14,14 Z"></path></svg>
                   </span>Search
                 </button>
            </form>
            <!-- <a (click)="showModal()" class="uk-button uk-button-primary uk-float-right"><i></i> New Community </a> -->
        </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" 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-navbar-dropdown-nav"
                                    [attr.uk-tooltip]="getSelectedCommunities().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
                                    title="Select at least one community">
                                    <li><a [class]="getSelectedCommunities().length == 0 ? 'uk-disabled' : ''" (click)="confirmDeleteSelectedCommunities()"><i></i> Delete </a></li>
                                </ul>
                              </div>
                            </div>
                        </div>
                    </div>

                    <div *ngIf="!errorMessage && !showLoading">
                        <div class="gwt-HTML">
                            <div class="users-list">  <!--"row" class removed"-->
                                <div class="col-md-12">
                                  <table class="uk-table uk-table-striped">
                                    <thead>
                                        <tr>
                                            <th><input id="allCommunityCheckbox" type="checkbox" (change)="toggleCheckBoxes($event)"></th>
                                            <th>Name</th>
                                            <th>Actions</th>
                                        </tr>
                                    </thead>
                                    <tbody >
                                        <tr *ngFor="let check of checkboxes; let i=index">
                                            <td><input id="{{check.community._id}}" class="checkBox" type="checkbox"
                                                                                name="communitiescb[]" value="{{check.community._id}}" [(ngModel)]="check.checked">
                                            </td>
                                            <td>
                                                <div class="name" href="#">{{check.community.name}}</div>
                                            </td>
                                            <td>
                                                <div class="actions" href="#">
                                                    <input title="Edit" src="assets/imgs/icn_edit.png" class="edit uk-margin-small-right" type="image" (click)="editCommunity(i)">
                                                    <input title="Delete" src="assets/imgs/icn_trash.png" class="delete" type="image" (click)="confirmDeleteCommunity(check.community._id)">
                                                </div>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>

                                    <div *ngIf="checkboxes.length==0" class="col-md-12">
                                        <div class="uk-alert-warning" uk-alert>No communities found</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- <fab (clicked)="showModal()"></fab> -->
        <fab (clicked)="newCommunity()"></fab>
</div>
<!-- <modal-form #saveModal [saveText]="'Save'" [titleText]="'Add a new Community'" [formGroup]="formGroup" [type]="'community'"
            [isModalShown]="isModalShown" (emmitObject)="communitySavedSuccessfully($event)" (emmitError)="handleUpdateError($event)">
    <community-form [group]="formGroup"></community-form>
</modal-form>

<modal-form #updateModal [saveText]="'Update'" [titleText]="'Update Community'" [formGroup]="formGroup" [type]="'community'"
            [isModalShown]="isModalShown" (emmitObject)="communityUpdatedSuccessfully($event)" (emmitError)="handleUpdateError($event)">
    <community-form [group]="formGroup"></community-form>
</modal-form> -->

<modal-alert #AlertModalSaveCommunity (alertOutput)="communitySaveConfirmed($event)">
  <div *ngIf="modalErrorMessage" class="uk-alert-danger" uk-alert aria-hidden="true">{{ modalErrorMessage }}</div>
  <community-form [group]="formGroup"></community-form>
</modal-alert>

<modal-alert #AlertModalUpdateCommunity (alertOutput)="communityUpdateConfirmed($event)">
  <div *ngIf="modalErrorMessage" class="uk-alert-danger" uk-alert aria-hidden="true">{{ modalErrorMessage }}</div>
  <community-form [group]="formGroup"></community-form>
</modal-alert>

<!-- <delete-confirmation-dialog #deleteConfirmationModal [isModalShown]="isModalShown" (emmitObject)="confirmedDeleteCommunities($event)">
    Are you sure you want to delete the selected community(-ies)?
</delete-confirmation-dialog> -->
<modal-alert #AlertModalDeleteCommunities (alertOutput)="confirmedDeleteCommunities($event)"></modal-alert>
