Redo header bar to trim options when we can and make the repositories page the default landing page for logged in users

This commit is contained in:
Joseph Schorr 2015-04-08 15:15:21 -04:00
parent af468a8c6a
commit 2e3704f7ba
6 changed files with 47 additions and 32 deletions

View file

@ -13,26 +13,30 @@ angular.module('quay').directive('headerBar', function () {
scope: {
},
controller: function($rootScope, $scope, $element, $location, $timeout, hotkeys, UserService, PlanService, ApiService, NotificationService, Config, CreateService) {
// Register hotkeys:
hotkeys.add({
combo: '/',
description: 'Show search',
callback: function(e) {
e.preventDefault();
e.stopPropagation();
$scope.toggleSearch();
}
});
$scope.isNewLayout = Config.isNewLayout();
hotkeys.add({
combo: 'alt+c',
description: 'Create new repository',
callback: function(e) {
e.preventDefault();
e.stopPropagation();
$location.url('/new');
}
});
if ($scope.isNewLayout) {
// Register hotkeys:
hotkeys.add({
combo: '/',
description: 'Show search',
callback: function(e) {
e.preventDefault();
e.stopPropagation();
$scope.toggleSearch();
}
});
hotkeys.add({
combo: 'alt+c',
description: 'Create new repository',
callback: function(e) {
e.preventDefault();
e.stopPropagation();
$location.url('/new');
}
});
}
$scope.notificationService = NotificationService;
$scope.searchVisible = false;
@ -43,7 +47,6 @@ angular.module('quay').directive('headerBar', function () {
// Monitor any user changes and place the current user into the scope.
UserService.updateUserIn($scope);
$scope.isNewLayout = Config.isNewLayout();
$scope.currentPageContext = {};

View file

@ -1,6 +1,7 @@
(function() {
/**
* Landing page.
* DEPRECATED: Remove the code for viewing when logged in.
*/
angular.module('quayPages').config(['pages', function(pages) {
pages.create('landing', 'landing.html', LandingCtrl, {
@ -8,7 +9,7 @@
});
}]);
function LandingCtrl($scope, UserService, ApiService, Features, Config) {
function LandingCtrl($scope, $location, UserService, ApiService, Features, Config) {
$scope.namespace = null;
$scope.currentScreenshot = 'repo-view';
@ -16,7 +17,12 @@
loadMyRepos(namespace);
});
UserService.updateUserIn($scope, function() {
UserService.updateUserIn($scope, function(user) {
if (!user.anonymous && Config.isNewLayout()) {
$location.path('/repository');
return;
}
loadMyRepos($scope.namespace);
});

View file

@ -1,6 +1,6 @@
(function() {
/**
* Page which displays the list of organizations of which the user is a member.
* DEPRECATED: Page which displays the list of organizations of which the user is a member.
*/
angular.module('quayPages').config(['pages', function(pages) {
pages.create('organizations', 'organizations.html', OrgsCtrl, {

View file

@ -12,7 +12,8 @@ function(ApiService, CookieService, $rootScope, Config) {
username: null,
email: null,
organizations: [],
logins: []
logins: [],
beforeload: true
}
var userService = {}