Merge branch 'orgs' of https://bitbucket.org/yackob03/quay into orgs

This commit is contained in:
Joseph Schorr 2013-11-05 14:47:56 -05:00
commit 6e2b2126a6
7 changed files with 148 additions and 49 deletions

View file

@ -131,7 +131,7 @@ function SigninCtrl($scope, $location, $timeout, Restangular, KeyService, UserSe
function PlansCtrl($scope, UserService, PlanService) {
// Load the list of plans.
PlanService.getPlanList(function(plans) {
PlanService.getPlans(function(plans) {
$scope.plans = plans;
$scope.status = 'ready';
});
@ -679,8 +679,8 @@ function RepoAdminCtrl($scope, Restangular, $routeParams, $rootScope) {
function UserAdminCtrl($scope, $timeout, Restangular, PlanService, UserService, KeyService, $routeParams) {
// Load the list of plans.
PlanService.getPlanList(function(plans) {
$scope.plans = plans;
PlanService.getPlans(function(plans) {
$scope.plans = plans.user;
});
$scope.$watch(function () { return UserService.currentUser(); }, function (currentUser) {
@ -987,7 +987,7 @@ function NewRepoCtrl($scope, $location, $http, $timeout, UserService, Restangula
var privateAllowed = $scope.subscription.usedPrivateRepos < $scope.subscribedPlan.privateRepos;
if (!privateAllowed) {
// If not, find the minimum repository that does.
PlanService.getMinimumPlan($scope.subscription.usedPrivateRepos + 1, function(minimum) {
PlanService.getMinimumPlan($scope.subscription.usedPrivateRepos + 1, !$scope.isUserNamespace, function(minimum) {
$scope.planRequired = minimum;
});
}
@ -1051,6 +1051,7 @@ function NewRepoCtrl($scope, $location, $http, $timeout, UserService, Restangula
// Watch the namespace on the repo. If it changes, we update the plan and the public/private
// accordingly.
$scope.isUserNamespace = true;
$scope.$watch('repo.namespace', function(namespace) {
// Note: Can initially be undefined.
if (!namespace) { return; }
@ -1064,7 +1065,7 @@ function NewRepoCtrl($scope, $location, $http, $timeout, UserService, Restangula
// Load the user's subscription information in case they want to create a private
// repository.
UserService.getCurrentSubscription(subscribedToPlan, function() {
PlanService.getMinimumPlan(1, function(minimum) { $scope.planRequired = minimum; });
PlanService.getMinimumPlan(1, false, function(minimum) { $scope.planRequired = minimum; });
});
} else {
$scope.planRequired = null;