Merge branch 'orgs' of ssh://bitbucket.org/yackob03/quay into orgs
Conflicts: static/partials/new-organization.html
This commit is contained in:
commit
9f1bf1499d
9 changed files with 123 additions and 50 deletions
|
@ -15,8 +15,11 @@ $.fn.clipboardCopy = function() {
|
|||
};
|
||||
|
||||
function HeaderCtrl($scope, $location, UserService, Restangular) {
|
||||
$scope.$watch( function () { return UserService.currentUser(); }, function (currentUser) {
|
||||
var searchToken = 0;
|
||||
|
||||
$scope.$watch( function () { return UserService.currentUser(); }, function (currentUser) {
|
||||
$scope.user = currentUser;
|
||||
++searchToken;
|
||||
}, true);
|
||||
|
||||
$scope.signout = function() {
|
||||
|
@ -40,6 +43,11 @@ function HeaderCtrl($scope, $location, UserService, Restangular) {
|
|||
name: 'repositories',
|
||||
remote: {
|
||||
url: '/api/find/repository?query=%QUERY',
|
||||
replace: function (url, uriEncodedQuery) {
|
||||
url = url.replace('%QUERY', uriEncodedQuery);
|
||||
url += '&cb=' + searchToken;
|
||||
return url;
|
||||
},
|
||||
filter: function(data) {
|
||||
var datums = [];
|
||||
for (var i = 0; i < data.repositories.length; ++i) {
|
||||
|
@ -214,11 +222,13 @@ function LandingCtrl($scope, $timeout, $location, Restangular, UserService, KeyS
|
|||
if (namespace == $scope.user.username) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (var i = 0; i < $scope.user.organizations.length; ++i) {
|
||||
var org = $scope.user.organizations[i];
|
||||
if (org.name == namespace) {
|
||||
return org.can_create_repo;
|
||||
|
||||
if ($scope.user.organizations) {
|
||||
for (var i = 0; i < $scope.user.organizations.length; ++i) {
|
||||
var org = $scope.user.organizations[i];
|
||||
if (org.name == namespace) {
|
||||
return org.can_create_repo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -711,11 +721,19 @@ function UserAdminCtrl($scope, $timeout, $location, Restangular, PlanService, Us
|
|||
$scope.updatingUser = false;
|
||||
$scope.changePasswordSuccess = false;
|
||||
$scope.convertStep = 0;
|
||||
|
||||
$scope.org = {};
|
||||
|
||||
$('.form-change-pw').popover();
|
||||
|
||||
$scope.showConvertForm = function() {
|
||||
PlanService.getMatchingBusinessPlan(function(plan) {
|
||||
$scope.org.plan = plan;
|
||||
});
|
||||
|
||||
PlanService.getPlans(function(plans) {
|
||||
$scope.orgPlans = plans.business;
|
||||
});
|
||||
|
||||
$scope.convertStep = 1;
|
||||
};
|
||||
|
||||
|
@ -728,7 +746,8 @@ function UserAdminCtrl($scope, $timeout, $location, Restangular, PlanService, Us
|
|||
|
||||
var data = {
|
||||
'adminUser': $scope.org.adminUser,
|
||||
'adminPassword': $scope.org.adminPassword
|
||||
'adminPassword': $scope.org.adminPassword,
|
||||
'plan': $scope.org.plan.stripeId
|
||||
};
|
||||
|
||||
var convertAccount = Restangular.one('user/convert');
|
||||
|
@ -1016,7 +1035,7 @@ function NewRepoCtrl($scope, $location, $http, $timeout, UserService, Restangula
|
|||
};
|
||||
|
||||
$scope.upgradePlan = function() {
|
||||
PlanService.showSubscribeDialog($scope, $scope.planRequired.stripeId, null, function() {
|
||||
PlanService.changePlan($scope, null, $scope.planRequired.stripeId, null, function() {
|
||||
// Subscribing.
|
||||
$scope.planChanging = true;
|
||||
}, function(plan) {
|
||||
|
|
Reference in a new issue