-
Notifications
You must be signed in to change notification settings - Fork 725
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Limit buttons in case of large content range (closes #296) * Add link to first and last page * Use default Bootstrap markup for pagination
- Loading branch information
1 parent
33f2d9d
commit 4e17b6e
Showing
4 changed files
with
129 additions
and
24 deletions.
There are no files selected for viewing
26 changes: 16 additions & 10 deletions
26
src/javascripts/ng-admin/Crud/list/DatagridPagination.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
<div ng-if="!paginationCtrl.infinite"> | ||
<div class="grid-detail"> | ||
<span class="total" ng-if="paginationCtrl.totalItems > 0"> | ||
<nav class="pagination-bar"> | ||
|
||
<div class="total" ng-if="paginationCtrl.totalItems > 0"> | ||
<strong>{{ paginationCtrl.offsetBegin }}</strong> - <strong>{{ paginationCtrl.offsetEnd }}</strong> on <strong>{{ paginationCtrl.totalItems }}</strong> | ||
</span> | ||
<span class="total no-record" ng-if="paginationCtrl.totalItems == 0"> | ||
</div> | ||
|
||
<div class="total no-record" ng-if="paginationCtrl.totalItems == 0"> | ||
<strong>No record found.</strong> | ||
</span> | ||
<div class="btn-group btn-group-sm" role="group" aria-label="pagination" ng-if="paginationCtrl.displayPagination"> | ||
<a href class="btn btn-default" ng-if="paginationCtrl.page != 1" ng-click="paginationCtrl.setPage(paginationCtrl.page - 1)">« Prev</a> | ||
<a href class="btn btn-default" ng-if="paginationCtrl.nbPages > 1" ng-repeat="n in paginationCtrl.range(1, paginationCtrl.nbPages)" ng-class="{'active': n == paginationCtrl.page}" ng-click="paginationCtrl.setPage(n)">{{ n }}</a> | ||
<a href class="btn btn-default" ng-if="paginationCtrl.page != paginationCtrl.nbPages" ng-click="paginationCtrl.setPage(paginationCtrl.page + 1)">Next »</a> | ||
</div> | ||
</div> | ||
|
||
<ul class="pagination pagination-sm pull-right" role="group" aria-label="pagination" ng-if="paginationCtrl.displayPagination"> | ||
<li><a href ng-if="paginationCtrl.page != 1" ng-click="paginationCtrl.setPage(paginationCtrl.page - 1)">« Prev</a></li> | ||
<li ng-repeat="n in paginationCtrl.range(paginationCtrl.page) track by $index" ng-class="{'active': n == paginationCtrl.page}"> | ||
<a href ng-if="n != '.'" ng-click="paginationCtrl.setPage(n)">{{ n }}</a> | ||
<span ng-if="n == '.'">…</span> | ||
</li> | ||
<li><a href ng-if="paginationCtrl.page != paginationCtrl.nbPages" ng-click="paginationCtrl.setPage(paginationCtrl.page + 1)">Next »</a></li> | ||
</ul> | ||
</nav> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters