<ion-view view-title="Rejects">
  <ion-content class="defect-page has-header" scroll="false">
    <div class="row" style="height:100%; width: 100%;" ng-show="opsrejectsctrl.currentRejects.length==0">
      <div class="valign-wrapper empty-message">
        <div class="valign">
          <i class="icon ion-information-circled"></i>
          <br>
          No rejects for this operation
        </div>
      </div>
    </div>
    <div class="row margin-top-20"  ng-show="opsrejectsctrl.currentRejects.length >0">
      <div class="col">
        <ion-list class="operation-list">
          <ion-item class="item-icon-right"
                    ng-repeat="issuel in opsrejectsctrl.currentRejects | startFrom:currentPagei*pageSize | limitTo:pageSize/2 :0"
                    ng-click="opsrejectsctrl.rejectClick(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 opsrejectsctrl.currentRejects | startFrom:(currentPagei*pageSize+7) | limitTo:pageSize/2 :0"
                    ng-click="opsrejectsctrl.rejectClick(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="opsrejectsctrl.currentRejects.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(opsrejectsctrl.currentRejects)}}page(s)</span>
          <button class="button button-positive button-clear"
                  ng-disabled="currentPagei >= opsrejectsctrl.currentRejects.length/pageSize - 1"
                  ng-click="currentPagei=currentPagei+1">
            Next
          </button>
        </div>
      </div>
    </div>
    <div class="row"  ng-show="opsrejectsctrl.currentRejects.length >0">
      <div class="col">
        <button ng-click="opsrejectsctrl.save()" ng-disabled="opsrejectsctrl.selectedRejects.length==0"
                class="defects-done button button-positive button-fab pull-right">
          Done
        </button>
      </div>
    </div>
  </ion-content>
</ion-view>
