1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +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:
Leigh 2016-02-15 15:01:27 -05:00
commit bed6c666ae
4 changed files with 37 additions and 5 deletions

View File

@ -613,6 +613,10 @@ var tower = angular.module('Tower', [
data: { data: {
activityStreamId: 'organization_id' activityStreamId: 'organization_id'
}, },
ncyBreadcrumb: {
parent: "organizations",
label: "{{name}}"
},
resolve: { resolve: {
features: ['FeaturesService', function(FeaturesService) { features: ['FeaturesService', function(FeaturesService) {
return FeaturesService.get(); return FeaturesService.get();

View File

@ -52,6 +52,7 @@
.BreadCrumb-item { .BreadCrumb-item {
display: inline-block; display: inline-block;
color: #B7B7B7; color: #B7B7B7;
text-transform: uppercase;
} }
.BreadCrumb-item + .BreadCrumb-item:before { .BreadCrumb-item + .BreadCrumb-item:before {

View File

@ -12,13 +12,38 @@
export function OrganizationsList($stateParams, $scope, $rootScope, $location, 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) { $state) {
ClearScope(); 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) { var parseCardData = function (cards) {
return cards.map(function (card) { return cards.map(function (card) {
var val = {}; var val = {};
@ -150,7 +175,7 @@ export function OrganizationsList($stateParams, $scope, $rootScope, $location,
} }
OrganizationsList.$inject = ['$stateParams', '$scope', '$rootScope', 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', 'ProcessErrors', 'GetBasePath', 'Wait',
'$state' '$state'
]; ];
@ -354,4 +379,4 @@ OrganizationsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location',
'$log', '$stateParams', 'OrganizationForm', 'GenerateForm', 'Rest', 'Alert', '$log', '$stateParams', 'OrganizationForm', 'GenerateForm', 'Rest', 'Alert',
'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit', 'Prompt', 'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit', 'Prompt',
'ClearScope', 'GetBasePath', 'Wait', '$state' 'ClearScope', 'GetBasePath', 'Wait', '$state'
]; ];

View File

@ -57,4 +57,6 @@
</div> </div>
</div> </div>
</div> </div>
</div> <div id="pagination-container" ng-hide="organization_num_pages < 2">
</div>
</div>