Merge pull request #1803 from TypicalGitHubUser/pending-tasks-pagination

Add pagination in "Pending Tasks"
This commit is contained in:
Shaik Nazeer Hussain 2017-01-23 13:24:38 +05:30 committed by GitHub
commit 15b7cbca20
2 changed files with 97 additions and 78 deletions

View File

@ -15,6 +15,8 @@
scope.restrictDate = new Date(); scope.restrictDate = new Date();
//this value will be changed within each specific tab //this value will be changed within each specific tab
scope.requestIdentifier = "loanId"; scope.requestIdentifier = "loanId";
scope.itemsPerPage = 15;
resourceFactory.checkerInboxResource.get({templateResource: 'searchtemplate'}, function (data) { resourceFactory.checkerInboxResource.get({templateResource: 'searchtemplate'}, function (data) {
scope.checkerTemplate = data; scope.checkerTemplate = data;

View File

@ -107,7 +107,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr class="pointer-main" ng-repeat="data in searchData"> <tr class="pointer-main" dir-paginate="data in searchData | itemsPerPage: itemsPerPage" pagination-id="inbox">
<td><input type="checkbox" data-ng-model="checkData[data.id]"/></td> <td><input type="checkbox" data-ng-model="checkData[data.id]"/></td>
<td class="pointer" data-ng-click="routeTo(data.id)">{{data.id}}</td> <td class="pointer" data-ng-click="routeTo(data.id)">{{data.id}}</td>
<td class="pointer" data-ng-click="routeTo(data.id)">{{data.madeOnDate | DateFormat}}</td> <td class="pointer" data-ng-click="routeTo(data.id)">{{data.madeOnDate | DateFormat}}</td>
@ -119,6 +119,12 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<div>
<center>
<dir-pagination-controls pagination-id="inbox"
boundary-links="true" template-url="bower_components/angular-utils-pagination/dirPagination.tpl.html" />
</center>
</div>
</tab> </tab>
<tab heading="{{'label.heading.clientapproval' | translate}}" has-permission='READ_CLIENT'> <tab heading="{{'label.heading.clientapproval' | translate}}" has-permission='READ_CLIENT'>
<div class="head-affix"> <div class="head-affix">
@ -139,52 +145,56 @@
</table> </table>
</div> </div>
<script type="text/ng-template" id="approveclient.html"> <script type="text/ng-template" id="approveclient.html">
<div class="modal-header silver"> <div class="modal-header silver">
<h3 class="bolder">{{'label.heading.enterclientsactivationdate' | <h3 class="bolder">{{'label.heading.enterclientsactivationdate' |
translate}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</h3> translate}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</h3>
</div> </div>
<div class="modal-body modal-big"> <div class="modal-body modal-big">
<api-validate></api-validate> <api-validate></api-validate>
<br> <br>
<input type="text" datepicker-pop="dd MMMM yyyy" ng-model="date.actDate" is-open="opened" min="restrictDate" <input type="text" datepicker-pop="dd MMMM yyyy" ng-model="date.actDate" is-open="opened" min="restrictDate"
max="restrictDate"/> max="restrictDate"/>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button class="btn btn-warning" ng-click="cancel()">{{'label.button.cancel' | translate}}</button> <button class="btn btn-warning" ng-click="cancel()">{{'label.button.cancel' | translate}}</button>
<button class="btn btn-primary" ng-click="approve(date.actDate)">{{'label.button.confirm' | translate}} <button class="btn btn-primary" ng-click="approve(date.actDate)">{{'label.button.confirm' | translate}}</button>
</button> </div>
</div> </script>
</script> <div ng-repeat="(officeName,values) in groupedClients">
<table class="table condensed-table" ng-repeat="(officeName,values) in groupedClients"> <table class="table condensed-table">
<tr> <tr>
<td> <td>
<strong>{{officeName}}</strong> <strong>{{officeName}}</strong>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<table class="table condensed-table"> <table class="table condensed-table">
<thead> <thead>
<tr class="graybg"> <tr class="graybg">
<th><input type="checkbox" ng-click="clientApprovalAllCheckBoxesClicked(officeName)" ng-checked="clientApprovalAllCheckBoxesMet(officeName)"/></th> <th><input type="checkbox" ng-click="clientApprovalAllCheckBoxesClicked(officeName)" ng-checked="clientApprovalAllCheckBoxesMet(officeName)"/></th>
<th>{{'label.heading.name' | translate}}</th> <th>{{'label.heading.name' | translate}}</th>
<th>{{'label.heading.accnum' | translate}}</th> <th>{{'label.heading.accnum' | translate}}</th>
<th>{{'label.heading.staff' | translate}}</th> <th>{{'label.heading.staff' | translate}}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr class="pointer-main" <tr class="pointer-main"
data-ng-repeat="client in values | filter : {active: 'false', status.value:'Pending'} | filter:filterText"> dir-paginate="client in values | filter : {active: 'false', status.value:'Pending'} | filter:filterText | itemsPerPage: itemsPerPage"
<td><input type="checkbox" data-ng-model="approveData[client.id]"/></td> pagination-id="'_' + $index">
<td class="pointer" data-ng-click="routeToClient(client.id)">{{client.displayName}}</td> <td><input type="checkbox" data-ng-model="approveData[client.id]"/></td>
<td class="pointer" data-ng-click="routeToClient(client.id)">{{client.accountNo}}</td> <td class="pointer" data-ng-click="routeToClient(client.id)">{{client.displayName}}</td>
<td class="pointer" data-ng-click="routeToClient(client.id)">{{client.staffName}}</td> <td class="pointer" data-ng-click="routeToClient(client.id)">{{client.accountNo}}</td>
</tr> <td class="pointer" data-ng-click="routeToClient(client.id)">{{client.staffName}}</td>
</tbody> </tr>
</table> </tbody>
</td> </table>
</tr> </td>
</table> </tr>
</table>
<dir-pagination-controls pagination-id="'_' + $index"
boundary-links="true" template-url="bower_components/angular-utils-pagination/dirPagination.tpl.html"/>
</div>
</tab> </tab>
<tab heading="{{'label.heading.loanapproval' | translate}}" has-permission='READ_LOAN'> <tab heading="{{'label.heading.loanapproval' | translate}}" has-permission='READ_LOAN'>
<div class="head-affix"> <div class="head-affix">
@ -215,36 +225,40 @@
<button class="btn btn-primary" ng-click="approve()">{{'label.button.confirm' | translate}}</button> <button class="btn btn-primary" ng-click="approve()">{{'label.button.confirm' | translate}}</button>
</div> </div>
</script> </script>
<table ng-repeat="office in offices" class="table condensed-table"> <div ng-repeat="office in offices">
<tr ng-show="office.loans.length > 0"> <table class="table condensed-table">
<td><strong>{{office.name}}</strong></td> <tr ng-show="office.loans.length > 0">
</tr> <td><strong>{{office.name}}</strong></td>
<tr ng-show="office.loans.length > 0"> </tr>
<td> <tr ng-show="office.loans.length > 0">
<table class="table condensed-table"> <td>
<thead> <table class="table condensed-table">
<tr class="graybg"> <thead>
<th><input type="checkbox" ng-click="loanApprovalAllCheckBoxesClicked(office)" ng-checked="loanApprovalAllCheckBoxesMet(office)"/></th> <tr class="graybg">
<th>{{'label.heading.client' | translate}}</th> <th><input type="checkbox" ng-click="loanApprovalAllCheckBoxesClicked(office)" ng-checked="loanApprovalAllCheckBoxesMet(office)"/></th>
<th>{{'label.heading.loan' | translate}}</th> <th>{{'label.heading.client' | translate}}</th>
<th>{{'label.heading.amount' | translate}}</th> <th>{{'label.heading.loan' | translate}}</th>
<th>{{'label.heading.loanpurpose' | translate}}</th> <th>{{'label.heading.amount' | translate}}</th>
</tr> <th>{{'label.heading.loanpurpose' | translate}}</th>
</thead> </tr>
<tbody> </thead>
<tr ng-repeat="loan in office.loans | filter:filterText1"> <tbody>
<td><input type="checkbox" ng-model="loanTemplate[loan.id]"></td> <tr dir-paginate="loan in office.loans | filter:filterText1 | itemsPerPage:itemsPerPage" pagination-id="'__' + $index">
<td class="pointer"><a href='#/viewclient/{{loan.clientId}}'>{{loan.clientName}}</a></td> <td><input type="checkbox" ng-model="loanTemplate[loan.id]"></td>
<td class="pointer"><a href='#/viewloanaccount/{{loan.id}}'>{{loan.loanProductName}}({{loan.accountNo}})</a> <td class="pointer"><a href='#/viewclient/{{loan.clientId}}'>{{loan.clientName}}</a></td>
</td> <td class="pointer"><a href='#/viewloanaccount/{{loan.id}}'>{{loan.loanProductName}}({{loan.accountNo}})</a>
<td class="pointer">{{loan.principal | number}}</td> </td>
<td class="pointer">{{loan.loanPurposeName}}</td> <td class="pointer">{{loan.principal | number}}</td>
</tr> <td class="pointer">{{loan.loanPurposeName}}</td>
</tbody> </tr>
</table> </tbody>
</td> </table>
</tr> </td>
</table> </tr>
</table>
<dir-pagination-controls pagination-id="'__' + $index"
boundary-links="true" template-url="bower_components/angular-utils-pagination/dirPagination.tpl.html"/>
</div>
</tab> </tab>
<tab heading="{{'label.heading.loandisbursal' | translate}}" has-permission='READ_LOAN'> <tab heading="{{'label.heading.loandisbursal' | translate}}" has-permission='READ_LOAN'>
<div class="head-affix"> <div class="head-affix">
@ -287,7 +301,8 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="loan in loans | filter : {status.waitingForDisbursal :'true' }| filter:filterText2"> <tr dir-paginate="loan in loans | filter : {status.waitingForDisbursal :'true' }| filter:filterText2 | itemsPerPage: itemsPerPage"
pagination-id="loan-disbursal">
<td><input type="checkbox" ng-model="loanDisbursalTemplate[loan.id]"></td> <td><input type="checkbox" ng-model="loanDisbursalTemplate[loan.id]"></td>
<td><a href="#/viewclient/{{loan.clientId}}">{{loan.clientName}}</a></td> <td><a href="#/viewclient/{{loan.clientId}}">{{loan.clientName}}</a></td>
<td><a href="#/viewloanaccount/{{loan.id}}">{{loan.accountNo}}</a></td> <td><a href="#/viewloanaccount/{{loan.id}}">{{loan.accountNo}}</a></td>
@ -296,6 +311,8 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<dir-pagination-controls pagination-id="loan-disbursal"
boundary-links="true" template-url="bower_components/angular-utils-pagination/dirPagination.tpl.html"/>
</div> </div>
</tab> </tab>