Fix create robot and create team in the new layout "new" header button

This commit is contained in:
Joseph Schorr 2015-04-23 14:40:01 -04:00
parent b02b98def3
commit 4dff6557ae
3 changed files with 35 additions and 12 deletions

View file

@ -211,11 +211,11 @@ angular.module('quay').directive('headerBar', function () {
$scope.createRobot = function(context) {
var namespace = $scope.getNamespace(context);
CreateService.askCreateRobot(function(created) {
if (isorg) {
$location.url('/organization/' + namespace + '?tab=robots');
CreateService.askCreateRobot(namespace, function(created) {
if (UserService.isOrganization(namespace)) {
$location.url('/organization/' + namespace + '?tab=robots&showRobot=' + created.name);
} else {
$location.url('/user/' + namespace + '?tab=robots');
$location.url('/user/' + namespace + '?tab=robots&showRobot=' + created.name);
}
});
};
@ -224,8 +224,8 @@ angular.module('quay').directive('headerBar', function () {
var namespace = $scope.getNamespace(context);
if (!namespace || !UserService.isNamespaceAdmin(namespace)) { return; }
CreateService.askCreateTeam(function(created) {
$location.url('/organization/' + namespace + '/teams/' + teamname);
CreateService.askCreateTeam(namespace, function(created) {
$location.url('/organization/' + namespace + '/teams/' + created.name);
});
};
}