<div class="blade-static">
    <div class="form-group">
      <div style="display: flex;align-items: center;">
        <a class="add" left-click-menu data-target="filterSearch{{blade.id}}" style="margin: 0 20px 0 0;">{{ filter.current ? filter.current.name : 'orders.blades.customerOrder-list.placeholders.select-filter' | translate }} <i class="form-ico fa fa-caret-down"></i></a>
        <ul class="menu __context" role="menu" id="filterSearch{{blade.id}}" style="width: 170px;">
          <li ng-repeat="x in $localStorage.orderSearchFilters" class="splited-element menu-item">
            <i class="menu-ico fas fa-plus" ng-if="!x.id"></i> <span ng-click='filter.current=x;filter.change();' ng-bind="x.name | translate"></span>
            <i class="fa fa-pencil right-alignment" ng-click='filter.current=x;filter.edit($event)' ng-if="x.id"></i>
          </li>
        </ul>

        <div class="form-input" style="flex-grow: 1; flex-grow: 1; max-width: 400px">
          <input ng-model="filter.keyword" ng-keyup="$event.which === 13 && filter.filterByKeyword()" placeholder="{{'platform.placeholders.search-keyword' | translate}}">
          <button class="btn __other" style="position: relative;right: 45px;" ng-click="filter.current=null;filter.change()">
            <i class="btn-ico fa fa-remove" title="Clear"></i>
          </button>
        </div>
      </div>
    </div>
</div>
<div class="blade-static __bottom" ng-if="pageSettings.itemsPerPageCount < pageSettings.totalItems" ng-include="'pagerTemplate.html'"></div>
<div class="blade-content" ng-class="{'__large-wide': blade.isExpanded, '__normal': !blade.isExpanded}">
    <div class="blade-inner">
        <div class="inner-block">
          <div class="table-wrapper" ng-init="setGridOptions('customerOrder-list-grid', getGridOptions())">
            <div ui-grid="gridOptions" ui-grid-auto-resize ui-grid-save-state ui-grid-selection ui-grid-resize-columns ui-grid-move-columns ui-grid-pinning ui-grid-height></div>
            <ng-include src="'order-list-context-menu.row.html'"></ng-include>
          </div>
        </div>
    </div>
</div>

<script type="text/ng-template" id="order-list.row.html">
    <div ng-click='grid.appScope.selectNode(row.entity)' ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.uid" ui-grid-one-bind-id-grid="rowRenderIndex + '-' + col.uid + '-cell'" class="ui-grid-cell" ng-class="{'ui-grid-row-header-cell': col.isRowHeader, '__hovered': grid.appScope.contextMenuEntity === row.entity, '__selected': row.entity.id===grid.appScope.selectedNodeId}" role="{{col.isRowHeader ? 'rowheader' : 'gridcell' }}" ui-grid-cell context-menu="grid.appScope.contextMenuEntity = row.entity" data-target="cor_menu"></div>
</script>
<script type="text/ng-template" id="list-actions.cell.html">
    <div class="ui-grid-actions" left-click-menu="grid.appScope.contextMenuEntity = row.entity" data-target="cor_menu">
        <i class="fa context-menu"></i>
    </div>
</script>
<script type="text/ng-template" id="order-list-context-menu.row.html">
  <ul class="menu __context" role="menu" id="cor_menu">
    <li class="menu-item" ng-click='selectNode(contextMenuEntity)' id="menu_edit">
      <i class="menu-ico fa fa-edit"></i> {{'platform.commands.manage' | translate}}
    </li>
    <li class="menu-item" ng-click='copy(contextMenuEntity.id)' id="menu_copyId">
      <i class="menu-ico fa fa-copy"></i> {{'orders.blades.customerOrder-list.labels.copy-id' | translate}}
    </li>
    <li class="menu-item" ng-click='copy(contextMenuEntity.number)' id="menu_copyNumber">
      <i class="menu-ico fa fa-copy"></i> {{'orders.blades.customerOrder-list.labels.copy-number' | translate}}
    </li>
    <li class="menu-item" ng-if="useIndexedSearch" ng-click='filterBy("CustomerName", contextMenuEntity.customerName)' id="menu_filterCustomerName">
      <i class="menu-ico fa fa-filter"></i> {{'orders.blades.customerOrder-list.labels.filter-by' | translate}} `{{contextMenuEntity.customerName}}`
    </li>
    <li class="menu-item" ng-if="useIndexedSearch && contextMenuEntity.organizationName" ng-click='filterBy("OrganizationName", contextMenuEntity.organizationName)' id="menu_filterOrganizationName">
      <i class="menu-ico fa fa-filter"></i> {{'orders.blades.customerOrder-list.labels.filter-by' | translate}} `{{contextMenuEntity.organizationName}}`
    </li>
    <li class="menu-item" ng-if="useIndexedSearch" ng-click='filterBy("StoreId", contextMenuEntity.storeId)' id="menu_filterStoreId">
      <i class="menu-ico fa fa-filter"></i> {{'orders.blades.customerOrder-list.labels.filter-by' | translate}} `{{contextMenuEntity.storeId}}`
    </li>
    <li class="menu-item" ng-if='!blade.hideDelete' ng-click='deleteList([contextMenuEntity])' va-permission="order:delete" id="menu_delete">
      <i class="menu-ico fas fa-trash-alt"></i> {{'platform.commands.delete' | translate}}
    </li>
  </ul>
</script>