
<ion-view view-title="Operations">

  <ion-content class="defect-page has-header" scroll="false">
        <div class="row">
          <div class="col">
            <button class="button button-clear no-animation style-number">
              Style :{{style}}
            </button>
            <button class="button button-positive button-clear icon-left ion-plus-circled no-animation pull-right" ng-click="operationsctrl.goTo('operations')">
              Add operations
            </button>
          </div>
        </div>
    <div class="row" style="height:80%; width: 100%;" ng-show="operationsctrl.operations.length==0">
      <div class="valign-wrapper empty-message">
        <div class="valign">
          <i class="icon ion-information-circled"></i>
          <br>
          Please select operations
        </div>
      </div>
    </div>
        <div class="row">
          <div class="col">
            <ion-list class="operation-list">
              <ion-item class="item-icon-right" ng-repeat="operationl in operationsctrl.operations | startFrom:currentPage*pageSize | limitTo:pageSize/2 :0"
                        ng-click="operationsctrl.operationClick(operationl)" ng-class="{ active: operationl.selected }">
                {{operationl.name}}
                <i class="icon ion-checkmark-circled"></i>
              </ion-item>
            </ion-list>
          </div>
          <div class="col">
            <ion-list class="operation-list">
              <ion-item class="item-icon-right" ng-repeat="operationr in operationsctrl.operations | startFrom:(currentPage*pageSize+pageSize/2) | limitTo:pageSize/2 :0"
                        ng-click="operationsctrl.operationClick(operationr)" ng-class="{ active: operationr.selected }">
                {{operationr.name}}
                <i class="icon ion-checkmark-circled"></i>
              </ion-item>
            </ion-list>
          </div>
        </div>
        <div class="row">
          <div class="col align-center button-wrapper">
            <div class="button-set">
              <button class="button button-positive button-clear" ng-disabled="currentPage == 0" ng-click="currentPage=currentPage-1">
                Previous
              </button>
              <span class="pagenumber">{{currentPage+1}}/{{numberOfPages(operationsctrl.operations)}}page(s)</span>
              <button class="button button-positive button-clear" ng-disabled="currentPage >= operationsctrl.operations.length/pageSize - 1" ng-click="currentPage=currentPage+1">
                Next
              </button>
            </div>
          </div>
        </div>
  </ion-content>
</ion-view>
