<ion-view view-title="Issues">
  <ion-content class="defect-page has-header" scroll="false">
    <div class="row" style="height:100%; width: 100%;" ng-show="opsissuesctrl.currentIssues.length==0">
      <div class="valign-wrapper empty-message">
        <div class="valign">
          <i class="icon ion-information-circled"></i>
          <br>
          No issues for this operation
        </div>
      </div>
    </div>
    <div class="row margin-top-20"  ng-show="opsissuesctrl.currentIssues.length >0">
      <div class="col">
        <ion-list class="operation-list">
          <ion-item class="item-icon-right"
                    ng-repeat="issuel in opsissuesctrl.currentIssues | startFrom:currentPagei*pageSize | limitTo:pageSize/2 :0"
                    ng-click="opsissuesctrl.issueClick(issuel)" ng-class="{ active: issuel.ischecked }">
            {{issuel.name}}<b class="number">{{issuel.category_id}}</b>
            <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="issuer in opsissuesctrl.currentIssues | startFrom:(currentPagei*pageSize+7) | limitTo:pageSize/2 :0"
                    ng-click="opsissuesctrl.issueClick(issuer)" ng-class="{ active: issuer.ischecked }">
            {{issuer.name}}<b class="number">{{issuer.category_id}}</b>
            <i class="icon ion-checkmark-circled"></i>
          </ion-item>
        </ion-list>
      </div>
    </div>
    <div class="row"  ng-show="opsissuesctrl.currentIssues.length >0">
      <div class="col align-center button-wrapper">
        <div class="button-set">
          <button class="button button-positive button-clear" ng-disabled="currentPagei == 0" ng-click="currentPagei=currentPagei-1">
            Previous
          </button>
          <span class="pagenumber">{{currentPagei+1}}/{{numberOfPages(opsissuesctrl.currentIssues)}}page(s)</span>
          <button class="button button-positive button-clear"
                  ng-disabled="currentPagei >= opsissuesctrl.currentIssues.length/pageSize - 1"
                  ng-click="currentPagei=currentPagei+1">
            Next
          </button>
        </div>
      </div>
    </div>
    <div class="row"  ng-show="opsissuesctrl.currentIssues.length >0">
      <div class="col">
        <button ng-click="opsissuesctrl.save()" ng-disabled="opsissuesctrl.selectedIssues.length==0"
                class="defects-done button button-positive button-fab pull-right">
          Done
        </button>
      </div>
    </div>
  </ion-content>
</ion-view>
