mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 10:11:05 -03:30
Merge pull request #84 from mabashian/7274-pagination
Fixed first/last pagination controls
This commit is contained in:
@@ -7,6 +7,7 @@ export default ['$scope', '$stateParams', '$state', '$filter', 'GetBasePath', 'Q
|
|||||||
$scope.pageSize = pageSize;
|
$scope.pageSize = pageSize;
|
||||||
|
|
||||||
$scope.basePageSize = parseInt(pageSize) === 5 ? 5 : 20;
|
$scope.basePageSize = parseInt(pageSize) === 5 ? 5 : 20;
|
||||||
|
$scope.maxVisiblePages = $scope.maxVisiblePages ? parseInt($scope.maxVisiblePages) : 10;
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
|
||||||
@@ -94,7 +95,7 @@ export default ['$scope', '$stateParams', '$state', '$filter', 'GetBasePath', 'Q
|
|||||||
|
|
||||||
function calcPageRange(current, last) {
|
function calcPageRange(current, last) {
|
||||||
let result = [],
|
let result = [],
|
||||||
maxVisiblePages = $scope.maxVisiblePages ? parseInt($scope.maxVisiblePages) : 10,
|
maxVisiblePages = parseInt($scope.maxVisiblePages),
|
||||||
pagesLeft,
|
pagesLeft,
|
||||||
pagesRight;
|
pagesRight;
|
||||||
if(maxVisiblePages % 2) {
|
if(maxVisiblePages % 2) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="Paginate-wrapper" ng-hide="dataset.count <= pageSize">
|
<div class="Paginate-wrapper" ng-hide="dataset.count <= pageSize">
|
||||||
<ul class="Paginate-controls pagination">
|
<ul class="Paginate-controls pagination">
|
||||||
<!-- first -->
|
<!-- first -->
|
||||||
<li class="Paginate-controls--first Paginate-controls--item" ng-hide="pageRange.length < 10 || {{current}} === 1">
|
<li class="Paginate-controls--first Paginate-controls--item" ng-hide="pageRange.length < maxVisiblePages || current === 1">
|
||||||
<a href ng-click="toPage(1)">
|
<a href ng-click="toPage(1)">
|
||||||
<i class="fa fa-angle-double-left"></i>
|
<i class="fa fa-angle-double-left"></i>
|
||||||
</a>
|
</a>
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<!-- last -->
|
<!-- last -->
|
||||||
<li class="Paginate-controls--item Paginate-controls--last" ng-hide="(pageRange.length < 10 || current === last)">
|
<li class="Paginate-controls--item Paginate-controls--last" ng-hide="(pageRange.length < maxVisiblePages || current === last)">
|
||||||
<a href id="last-page-set" ng-click="toPage(last)">
|
<a href id="last-page-set" ng-click="toPage(last)">
|
||||||
<i class="fa fa-angle-double-right"></i>
|
<i class="fa fa-angle-double-right"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export default {
|
|||||||
listTitle: 'INVENTORY SOURCES',
|
listTitle: 'INVENTORY SOURCES',
|
||||||
index: false,
|
index: false,
|
||||||
hover: true,
|
hover: true,
|
||||||
|
searchBarFullWidth: true,
|
||||||
|
|
||||||
fields: {
|
fields: {
|
||||||
name: {
|
name: {
|
||||||
|
|||||||
@@ -679,6 +679,7 @@ angular.module('templates', [surveyMaker.name, templatesList.name, jobTemplates.
|
|||||||
delete list.fields.last_updated;
|
delete list.fields.last_updated;
|
||||||
list.fields.name.columnClass = "col-md-11";
|
list.fields.name.columnClass = "col-md-11";
|
||||||
list.maxVisiblePages = 5;
|
list.maxVisiblePages = 5;
|
||||||
|
list.searchBarFullWidth = true;
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export default ['i18n', function(i18n) {
|
|||||||
selectInstructions: i18n.sprintf(i18n._("Click on a row to select it, and click Finished when done. Use the %s button to create a new job template."), "<i class=\"icon-plus\"></i> "),
|
selectInstructions: i18n.sprintf(i18n._("Click on a row to select it, and click Finished when done. Use the %s button to create a new job template."), "<i class=\"icon-plus\"></i> "),
|
||||||
index: false,
|
index: false,
|
||||||
hover: true,
|
hover: true,
|
||||||
|
searchBarFullWidth: true,
|
||||||
|
|
||||||
fields: {
|
fields: {
|
||||||
name: {
|
name: {
|
||||||
|
|||||||
Reference in New Issue
Block a user