Delete the old UI!

This commit is contained in:
Joseph Schorr 2015-06-29 12:33:00 +03:00
parent 33039e9bc4
commit ff3d8bb013
54 changed files with 308 additions and 4383 deletions

View file

@ -21,14 +21,6 @@ angular.module('quay').directive('entityReference', function () {
};
$scope.getRobotUrl = function(name) {
if (Config.isNewLayout()) {
return $scope.getNewRobotUrl(name);
} else {
return $scope.getOldRobotUrl(name);
}
};
$scope.getNewRobotUrl = function(name) {
var namespace = $scope.getPrefix(name);
if (!namespace) {
return '';
@ -47,26 +39,6 @@ angular.module('quay').directive('entityReference', function () {
return '/organization/' + org['name'] + '?tab=robots&showRobot=' + UtilService.textToSafeHtml(name);
};
// TODO(jschorr): Remove when new layout is in prod.
$scope.getOldRobotUrl = function(name) {
var namespace = $scope.getPrefix(name);
if (!namespace) {
return '';
}
if (!$scope.getIsAdmin(namespace)) {
return '';
}
var org = UserService.getOrganization(namespace);
if (!org) {
// This robot is owned by the user.
return '/user/?tab=robots&showRobot=' + UtilService.textToSafeHtml(name);
}
return '/organization/' + org['name'] + '/admin?tab=robots&showRobot=' + UtilService.textToSafeHtml(name);
};
$scope.getTitle = function(entity) {
if (!entity) { return ''; }

View file

@ -14,41 +14,36 @@ angular.module('quay').directive('headerBar', function () {
},
controller: function($rootScope, $scope, $element, $location, $timeout, hotkeys, UserService,
PlanService, ApiService, NotificationService, Config, CreateService, Features) {
$scope.isNewLayout = Config.isNewLayout();
var hotkeysAdded = false;
var userUpdated = function(cUser) {
$scope.searchingAllowed = Features.ANONYMOUS_ACCESS || !cUser.anonymous;
if (hotkeysAdded) { return; }
hotkeysAdded = true;
if ($scope.isNewLayout) {
hotkeysAdded = true;
// Register hotkeys.
if ($scope.searchingAllowed) {
hotkeys.add({
combo: '/',
description: 'Show search',
callback: function(e) {
e.preventDefault();
e.stopPropagation();
$scope.toggleSearch();
}
});
}
// Register hotkeys.
if ($scope.searchingAllowed) {
hotkeys.add({
combo: '/',
description: 'Show search',
callback: function(e) {
e.preventDefault();
e.stopPropagation();
$scope.toggleSearch();
}
});
}
if (!cUser.anonymous) {
hotkeys.add({
combo: 'alt+c',
description: 'Create new repository',
callback: function(e) {
e.preventDefault();
e.stopPropagation();
$location.url('/new');
}
});
}
if (!cUser.anonymous) {
hotkeys.add({
combo: 'alt+c',
description: 'Create new repository',
callback: function(e) {
e.preventDefault();
e.stopPropagation();
$location.url('/new');
}
});
}
};