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:
parent
af468a8c6a
commit
2e3704f7ba
6 changed files with 47 additions and 32 deletions
|
@ -5,20 +5,26 @@
|
||||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse" style="padding: 0px; padding-left: 4px; padding-right: 4px;">
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse" style="padding: 0px; padding-left: 4px; padding-right: 4px;">
|
||||||
≡
|
≡
|
||||||
</button>
|
</button>
|
||||||
<a class="navbar-brand" href="/" target="{{ appLinkTarget() }}">
|
<a class="navbar-brand" ng-href="{{ user.anonymous ? '/' : '/repository/' }}" target="{{ appLinkTarget() }}">
|
||||||
<span id="quay-logo" ng-style="{'background-image': 'url(' + getEnterpriseLogo() + ')'}"></span>
|
<span id="quay-logo" ng-style="{'background-image': 'url(' + getEnterpriseLogo() + ')'}"></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Collapsable stuff -->
|
<!-- Collapsable stuff -->
|
||||||
<div class="collapse navbar-collapse navbar-ex1-collapse">
|
<div class="collapse navbar-collapse navbar-ex1-collapse">
|
||||||
<ul class="nav navbar-nav navbar-links">
|
<!-- Not signed in -->
|
||||||
|
<ul class="nav navbar-nav navbar-links" ng-if="user.anonymous">
|
||||||
<li><a ng-href="/tour/" target="{{ appLinkTarget() }}" quay-section="tour">Tour</a></li>
|
<li><a ng-href="/tour/" target="{{ appLinkTarget() }}" quay-section="tour">Tour</a></li>
|
||||||
<li><a ng-href="/repository/" target="{{ appLinkTarget() }}" quay-section="repository">Repositories</a></li>
|
|
||||||
<li><a href="http://docs.quay.io/" target="_blank">Docs</a></li>
|
|
||||||
<li><a ng-href="/tutorial/" target="{{ appLinkTarget() }}" quay-section="tutorial">Tutorial</a></li>
|
<li><a ng-href="/tutorial/" target="{{ appLinkTarget() }}" quay-section="tutorial">Tutorial</a></li>
|
||||||
<li quay-require="['BILLING']"><a ng-href="/plans/" target="{{ appLinkTarget() }}" quay-section="plans">Pricing</a></li>
|
<li quay-require="['BILLING']"><a ng-href="/plans/" target="{{ appLinkTarget() }}" quay-section="plans">Pricing</a></li>
|
||||||
<li><a ng-href="{{ user.organizations.length ? '/organizations/' : '/tour/organizations/' }}" target="{{ appLinkTarget() }}" quay-section="organization">Organizations</a></li>
|
<li><a href="http://docs.quay.io/" target="_blank">Docs</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<!-- Signed in -->
|
||||||
|
<ul class="nav navbar-nav navbar-links" ng-if="!user.anonymous">
|
||||||
|
<li><a ng-href="/repository/" target="{{ appLinkTarget() }}" quay-section="repository">Repositories</a></li>
|
||||||
|
<li><a ng-href="/tutorial/" target="{{ appLinkTarget() }}" quay-section="tutorial">Tutorial</a></li>
|
||||||
|
<li><a href="http://docs.quay.io/" target="_blank">Docs</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<!-- Phone -->
|
<!-- Phone -->
|
||||||
|
@ -118,7 +124,6 @@
|
||||||
Account Settings
|
Account Settings
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a ng-href="/organizations/" target="{{ appLinkTarget() }}">Organizations</a></li>
|
|
||||||
<li ng-if="user.super_user"><a href="/superuser/"><strong>Super User Admin Panel</strong></a></li>
|
<li ng-if="user.super_user"><a href="/superuser/"><strong>Super User Admin Panel</strong></a></li>
|
||||||
<li><a href="javascript:void(0)" ng-click="signout()">Sign out</a></li>
|
<li><a href="javascript:void(0)" ng-click="signout()">Sign out</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -13,6 +13,9 @@ angular.module('quay').directive('headerBar', function () {
|
||||||
scope: {
|
scope: {
|
||||||
},
|
},
|
||||||
controller: function($rootScope, $scope, $element, $location, $timeout, hotkeys, UserService, PlanService, ApiService, NotificationService, Config, CreateService) {
|
controller: function($rootScope, $scope, $element, $location, $timeout, hotkeys, UserService, PlanService, ApiService, NotificationService, Config, CreateService) {
|
||||||
|
$scope.isNewLayout = Config.isNewLayout();
|
||||||
|
|
||||||
|
if ($scope.isNewLayout) {
|
||||||
// Register hotkeys:
|
// Register hotkeys:
|
||||||
hotkeys.add({
|
hotkeys.add({
|
||||||
combo: '/',
|
combo: '/',
|
||||||
|
@ -33,6 +36,7 @@ angular.module('quay').directive('headerBar', function () {
|
||||||
$location.url('/new');
|
$location.url('/new');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$scope.notificationService = NotificationService;
|
$scope.notificationService = NotificationService;
|
||||||
$scope.searchVisible = false;
|
$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.
|
// Monitor any user changes and place the current user into the scope.
|
||||||
UserService.updateUserIn($scope);
|
UserService.updateUserIn($scope);
|
||||||
|
|
||||||
$scope.isNewLayout = Config.isNewLayout();
|
|
||||||
|
|
||||||
$scope.currentPageContext = {};
|
$scope.currentPageContext = {};
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
(function() {
|
(function() {
|
||||||
/**
|
/**
|
||||||
* Landing page.
|
* Landing page.
|
||||||
|
* DEPRECATED: Remove the code for viewing when logged in.
|
||||||
*/
|
*/
|
||||||
angular.module('quayPages').config(['pages', function(pages) {
|
angular.module('quayPages').config(['pages', function(pages) {
|
||||||
pages.create('landing', 'landing.html', LandingCtrl, {
|
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.namespace = null;
|
||||||
$scope.currentScreenshot = 'repo-view';
|
$scope.currentScreenshot = 'repo-view';
|
||||||
|
|
||||||
|
@ -16,7 +17,12 @@
|
||||||
loadMyRepos(namespace);
|
loadMyRepos(namespace);
|
||||||
});
|
});
|
||||||
|
|
||||||
UserService.updateUserIn($scope, function() {
|
UserService.updateUserIn($scope, function(user) {
|
||||||
|
if (!user.anonymous && Config.isNewLayout()) {
|
||||||
|
$location.path('/repository');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
loadMyRepos($scope.namespace);
|
loadMyRepos($scope.namespace);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
(function() {
|
(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) {
|
angular.module('quayPages').config(['pages', function(pages) {
|
||||||
pages.create('organizations', 'organizations.html', OrgsCtrl, {
|
pages.create('organizations', 'organizations.html', OrgsCtrl, {
|
||||||
|
|
|
@ -12,7 +12,8 @@ function(ApiService, CookieService, $rootScope, Config) {
|
||||||
username: null,
|
username: null,
|
||||||
email: null,
|
email: null,
|
||||||
organizations: [],
|
organizations: [],
|
||||||
logins: []
|
logins: [],
|
||||||
|
beforeload: true
|
||||||
}
|
}
|
||||||
|
|
||||||
var userService = {}
|
var userService = {}
|
||||||
|
|
|
@ -11,10 +11,10 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Loading -->
|
<!-- Loading -->
|
||||||
<div class="cor-loader" ng-if="loading"></div>
|
<div class="cor-loader" ng-if="loading || user.beforeload"></div>
|
||||||
|
|
||||||
<!-- Not signed in -->
|
<!-- Not signed in -->
|
||||||
<div class="co-main-content-panel" ng-if="!loading && user.anonymous">
|
<div class="co-main-content-panel" ng-if="!loading && user.anonymous && !user.beforeload">
|
||||||
<!-- The user is not logged in -->
|
<!-- The user is not logged in -->
|
||||||
<div class="cor-container signin-container row">
|
<div class="cor-container signin-container row">
|
||||||
|
|
||||||
|
|
Reference in a new issue