44 lines
1.2 KiB
JavaScript
44 lines
1.2 KiB
JavaScript
|
(function() {
|
||
|
/**
|
||
|
* Billing plans page.
|
||
|
*/
|
||
|
angular.module('quayPages').config(['pages', function(pages) {
|
||
|
pages.create('billing', 'billing.html', BillingCtrl, {
|
||
|
'title': 'Billing',
|
||
|
'description': 'Billing',
|
||
|
'newLayout': true
|
||
|
});
|
||
|
}]);
|
||
|
|
||
|
/**
|
||
|
* Billing invoices page.
|
||
|
*/
|
||
|
angular.module('quayPages').config(['pages', function(pages) {
|
||
|
pages.create('invoices', 'invoices.html', BillingCtrl, {
|
||
|
'title': 'Billing Invoices',
|
||
|
'description': 'Billing Invoices',
|
||
|
'newLayout': true
|
||
|
});
|
||
|
}]);
|
||
|
|
||
|
|
||
|
function BillingCtrl($scope, ApiService, $routeParams) {
|
||
|
$scope.orgname = $routeParams['orgname'];
|
||
|
$scope.username = $routeParams['username'];
|
||
|
|
||
|
var loadEntity = function() {
|
||
|
if ($scope.orgname) {
|
||
|
$scope.entityResource = ApiService.getOrganizationAsResource({'orgname': $scope.orgname}).get(function(org) {
|
||
|
$scope.organization = org;
|
||
|
});
|
||
|
} else {
|
||
|
$scope.entityResource = ApiService.getUserInformationAsResource({'username': $scope.username}).get(function(user) {
|
||
|
$scope.viewuser = user;
|
||
|
});
|
||
|
}
|
||
|
};
|
||
|
|
||
|
// Load the user or organization.
|
||
|
loadEntity();
|
||
|
}
|
||
|
}());
|