From 6e2b8d96b82d58a19537ebaaa9ef02c449dd0aa4 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Sun, 6 Apr 2014 14:48:58 -0400 Subject: [PATCH] Add a simplified landing page for the case where billing is disabled --- config.py | 3 + static/js/app.js | 44 ++++++++ static/js/controllers.js | 14 ++- static/partials/landing-login.html | 58 +++++++++++ static/partials/landing-normal.html | 152 ++++++++++++++++++++++++++++ static/partials/landing.html | 151 +-------------------------- 6 files changed, 271 insertions(+), 151 deletions(-) create mode 100644 static/partials/landing-login.html create mode 100644 static/partials/landing-normal.html diff --git a/config.py b/config.py index b335e4d13..83138548b 100644 --- a/config.py +++ b/config.py @@ -118,6 +118,9 @@ class DefaultConfig(object): # Feature Flag: Whether GitHub login is supported. FEATURE_GITHUB_LOGIN = False + # Feature Flag: The logo for the enterprise. + FEATURE_ENTERPRISE_LOGO_URL = 'http://img2.wikia.nocookie.net/__cb20130328225038/logopedia/images/c/c8/Spotify_logo_detail.png' + class FakeTransaction(object): def __enter__(self): diff --git a/static/js/app.js b/static/js/app.js index b2e5e213c..2950a608d 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -1399,6 +1399,50 @@ quayApp.directive('quayClasses', function(Features) { }); +quayApp.directive('quayInclude', function($compile, $templateCache, $http, Features) { + return { + priority: 595, + restrict: 'A', + link: function($scope, $element, $attr, ctrl) { + var getTemplate = function(templateName) { + var templateUrl = '/static/partials/' + templateName; + return $http.get(templateUrl, {cache: $templateCache}); + }; + + var result = $scope.$eval($attr.quayInclude); + if (!result) { + return; + } + + var templatePath = null; + for (var expr in result) { + if (!result.hasOwnProperty(expr)) { continue; } + + // Evaluate the expression with the entire features list added. + var value = $scope.$eval(expr, Features); + if (value) { + templatePath = result[expr]; + break; + } + } + + if (!templatePath) { + return; + } + + var promise = getTemplate(templatePath).success(function(html) { + $element.html(html); + }).then(function (response) { + $element.replaceWith($compile($element.html())($scope)); + if ($attr.onload) { + $scope.$eval($attr.onload); + } + }); + } + }; +}); + + quayApp.directive('entityReference', function () { var directiveDefinitionObject = { priority: 0, diff --git a/static/js/controllers.js b/static/js/controllers.js index a7db3090c..cdd728f3d 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -262,7 +262,7 @@ function RepoListCtrl($scope, $sanitize, Restangular, UserService, ApiService) { loadPublicRepos(); } -function LandingCtrl($scope, UserService, ApiService) { +function LandingCtrl($scope, UserService, ApiService, Features) { $scope.namespace = null; $scope.$watch('namespace', function(namespace) { @@ -303,7 +303,17 @@ function LandingCtrl($scope, UserService, ApiService) { }); }; - browserchrome.update(); + $scope.chromify = function() { + browserchrome.update(); + }; + + $scope.getEnterpriseLogo = function() { + if (!Features.ENTERPRISE_LOGO_URL) { + return '/static/img/quay-logo.png'; + } + + return Features.ENTERPRISE_LOGO_URL; + }; } function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiService, $routeParams, $rootScope, $location, $timeout) { diff --git a/static/partials/landing-login.html b/static/partials/landing-login.html new file mode 100644 index 000000000..04c6bd5db --- /dev/null +++ b/static/partials/landing-login.html @@ -0,0 +1,58 @@ +
+
+
+
+
+
+ + + +

Quay.io Enterprise Edition

+
+ +
+ + +
+ +
+

Top Repositories

+ +
+ + +
+
+ You don't have access to any repositories in this organization yet. + You don't have any repositories yet! + +
+
+
+
+
+ +
+
+

Create Username

+ +
+
+ +
Welcome {{ user.username }}!
+ Browse all repositories + Create a new repository +
+
+
+ +
+
+
diff --git a/static/partials/landing-normal.html b/static/partials/landing-normal.html new file mode 100644 index 000000000..ccdfeb6b8 --- /dev/null +++ b/static/partials/landing-normal.html @@ -0,0 +1,152 @@ +
+
+
+
+
+
+

Secure hosting for private Docker* repositories

+

Use the Docker images your team needs with the safety of private repositories

+ +
+ +
+ + +
+ +
+

Top Repositories

+ +
+ + +
+
+ You don't have access to any repositories in this organization yet. + You don't have any repositories yet! + +
+
+
+
+
+ +
+
+ +
+
+ +
Welcome {{ user.username }}!
+ Browse all repositories + Create a new repository +
+
+
+ +
+
+ + Secure + + Your data is transferred using SSL at all times and encrypted when at rest. More information available in our security guide + +
+ +
+ + Shareable + + Have to share a repository? No problem! Share with anyone you choose + +
+ +
+ + Cloud Hosted + + Accessible from anywhere, anytime + +
+
+
+
+ +
+
+
+
Take a tour of Quay
+
+ +
+
+
+
Customized for you
+
+ Your personal home screen shows those repositories most important to you, ordered by recent activity. +
+
Keep up to date on the status of those repositories you deem important.
+
+
+ +
+
+
+
Useful views of respositories
+
+ Each repository is presented with the maximum amount of useful information, including its image history, markdown-based description, and tags. +
+
+
+ +
+
+
+
Dockerfile Build in the cloud
+
+ Like to use Dockerfiles to build your images? Simply upload your Dockerfile (and any additional files it needs) and we'll build your Dockerfile into an image and push it to your repository. +
+
+ If you store your Dockerfile in GitHub, add a Build Trigger to your repository and we'll start a Dockerfile build for every change you make. +
+
+
+ +
+
+
+
Share at your control
+
+ Share any repository with as many (or as few) users as you choose. +
+
Need a repository only for your team? Easily share with your team members.
+
Need finer grain control? Mark a user as read-only or read/write.
+
Have a build script or a deploy process that needs access? Generate an access token to grant revocable access for pushing or pulling.
+
Want to share with the world? Make your repository fully public.
+
+
+ +
+
+
+
Docker diff whenever you need it
+
+ We wanted to know what was changing in each image of our repositories just as much as you do. So we added diffs. Now you can see exactly which files were added, changed, or removed for each image. We've also provided two awesome ways to view your changes, either in a filterable list, or in a drill down tree view. +
+
+
+ +
+ Mobile Analytics +
+
+
diff --git a/static/partials/landing.html b/static/partials/landing.html index fe78d588c..98f8a32d2 100644 --- a/static/partials/landing.html +++ b/static/partials/landing.html @@ -1,150 +1,3 @@ -
-
-
-
-
-

Secure hosting for private Docker* repositories

-

Use the Docker images your team needs with the safety of private repositories

- -
- -
- - -
- -
-

Top Repositories

- -
- - -
-
- You don't have access to any repositories in this organization yet. - You don't have any repositories yet! - -
-
-
-
-
- -
-
- -
-
- -
Welcome {{ user.username }}!
- Browse all repositories - Create a new repository -
-
-
- -
-
- - Secure - - Your data is transferred using SSL at all times and encrypted when at rest. More information available in our security guide - -
- -
- - Shareable - - Have to share a repository? No problem! Share with anyone you choose - -
- -
- - Cloud Hosted - - Accessible from anywhere, anytime - -
-
-
-
- -
-
-
-
Take a tour of Quay
-
- -
-
-
-
Customized for you
-
- Your personal home screen shows those repositories most important to you, ordered by recent activity. -
-
Keep up to date on the status of those repositories you deem important.
-
-
- -
-
-
-
Useful views of respositories
-
- Each repository is presented with the maximum amount of useful information, including its image history, markdown-based description, and tags. -
-
-
- -
-
-
-
Dockerfile Build in the cloud
-
- Like to use Dockerfiles to build your images? Simply upload your Dockerfile (and any additional files it needs) and we'll build your Dockerfile into an image and push it to your repository. -
-
- If you store your Dockerfile in GitHub, add a Build Trigger to your repository and we'll start a Dockerfile build for every change you make. -
-
-
- -
-
-
-
Share at your control
-
- Share any repository with as many (or as few) users as you choose. -
-
Need a repository only for your team? Easily share with your team members.
-
Need finer grain control? Mark a user as read-only or read/write.
-
Have a build script or a deploy process that needs access? Generate an access token to grant revocable access for pushing or pulling.
-
Want to share with the world? Make your repository fully public.
-
-
- -
-
-
-
Docker diff whenever you need it
-
- We wanted to know what was changing in each image of our repositories just as much as you do. So we added diffs. Now you can see exactly which files were added, changed, or removed for each image. We've also provided two awesome ways to view your changes, either in a filterable list, or in a drill down tree view. -
-
-
- -
- Mobile Analytics -
+
+