mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 23:51:09 +03:00
Merge pull request #928 from leigh-johnson/OrgPaginate
#646 Handle case where page 2 of OrganizationList was being hidden
This commit is contained in:
commit
bed6c666ae
@ -613,6 +613,10 @@ var tower = angular.module('Tower', [
|
||||
data: {
|
||||
activityStreamId: 'organization_id'
|
||||
},
|
||||
ncyBreadcrumb: {
|
||||
parent: "organizations",
|
||||
label: "{{name}}"
|
||||
},
|
||||
resolve: {
|
||||
features: ['FeaturesService', function(FeaturesService) {
|
||||
return FeaturesService.get();
|
||||
|
@ -52,6 +52,7 @@
|
||||
.BreadCrumb-item {
|
||||
display: inline-block;
|
||||
color: #B7B7B7;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.BreadCrumb-item + .BreadCrumb-item:before {
|
||||
|
@ -12,13 +12,38 @@
|
||||
|
||||
|
||||
export function OrganizationsList($stateParams, $scope, $rootScope, $location,
|
||||
$log, Rest, Alert, Prompt, ClearScope, ProcessErrors, GetBasePath, Wait,
|
||||
$log, $compile, Rest, PaginateWidget, PaginateInit, SearchInit, OrganizationList, Alert, Prompt, ClearScope, ProcessErrors, GetBasePath, Wait,
|
||||
$state) {
|
||||
|
||||
ClearScope();
|
||||
|
||||
var defaultUrl = GetBasePath('organizations');
|
||||
var defaultUrl = GetBasePath('organizations'),
|
||||
list = OrganizationList,
|
||||
pageSize = $scope.orgCount;
|
||||
|
||||
PaginateInit({
|
||||
scope: $scope,
|
||||
list: list,
|
||||
url: defaultUrl,
|
||||
pageSize: pageSize,
|
||||
});
|
||||
SearchInit({
|
||||
scope: $scope,
|
||||
list: list,
|
||||
url: defaultUrl,
|
||||
});
|
||||
|
||||
$scope.search(list.iterator);
|
||||
|
||||
$scope.PaginateWidget = PaginateWidget({
|
||||
iterator: list.iterator,
|
||||
set: 'organizations'
|
||||
});
|
||||
|
||||
var paginationContainer = $('#pagination-container');
|
||||
paginationContainer.html($scope.PaginateWidget);
|
||||
$compile(paginationContainer.contents())($scope)
|
||||
|
||||
var parseCardData = function (cards) {
|
||||
return cards.map(function (card) {
|
||||
var val = {};
|
||||
@ -150,7 +175,7 @@ export function OrganizationsList($stateParams, $scope, $rootScope, $location,
|
||||
}
|
||||
|
||||
OrganizationsList.$inject = ['$stateParams', '$scope', '$rootScope',
|
||||
'$location', '$log', 'Rest', 'Alert', 'Prompt', 'ClearScope',
|
||||
'$location', '$log', '$compile', 'Rest', 'PaginateWidget', 'PaginateInit', 'SearchInit', 'OrganizationList', 'Alert', 'Prompt', 'ClearScope',
|
||||
'ProcessErrors', 'GetBasePath', 'Wait',
|
||||
'$state'
|
||||
];
|
||||
@ -354,4 +379,4 @@ OrganizationsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location',
|
||||
'$log', '$stateParams', 'OrganizationForm', 'GenerateForm', 'Rest', 'Alert',
|
||||
'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit', 'Prompt',
|
||||
'ClearScope', 'GetBasePath', 'Wait', '$state'
|
||||
];
|
||||
];
|
@ -57,4 +57,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="pagination-container" ng-hide="organization_num_pages < 2">
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user