diff --git a/static/directives/user-setup.html b/static/directives/user-setup.html new file mode 100644 index 000000000..099958e90 --- /dev/null +++ b/static/directives/user-setup.html @@ -0,0 +1,53 @@ +
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ + +
Unable to locate account.
+ +
Account recovery email was sent.
+
+
+
+
+
diff --git a/static/js/app.js b/static/js/app.js index cd4a9ad70..0ff7e230c 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -202,12 +202,18 @@ quayApp = angular.module('quay', ['ngRoute', 'restangular', 'angularMoment', 'an var planId = planService.getAndResetNotedPlan(); if (!planId) { return; } - planService.isBusinessPlan(planId, function(bus) { - if (bus) { - document.location = '/organizations/new/?plan=' + planId; - } else { - document.location = '/user?plan=' + planId; + UserService.load(function() { + if (UserService.currentUser().anonymous) { + return; } + + planService.isBusinessPlan(planId, function(bus) { + if (bus) { + document.location = '/organizations/new/?plan=' + planId; + } else { + document.location = '/user?plan=' + planId; + } + }); }); }; @@ -632,6 +638,35 @@ quayApp.directive('repoCircle', function () { }); +quayApp.directive('userSetup', function () { + var directiveDefinitionObject = { + priority: 0, + templateUrl: '/static/directives/user-setup.html', + replace: false, + transclude: true, + restrict: 'C', + scope: { + 'redirectUrl': '=redirectUrl', + 'signInStarted': '&signInStarted', + 'signedIn': '&signedIn' + }, + controller: function($scope, $location, $timeout, Restangular, KeyService, UserService) { + $scope.sendRecovery = function() { + var signinPost = Restangular.one('recovery'); + signinPost.customPOST($scope.recovery).then(function() { + $scope.invalidEmail = false; + $scope.sent = true; + }, function(result) { + $scope.invalidEmail = true; + $scope.sent = false; + }); + }; + } + }; + return directiveDefinitionObject; +}); + + quayApp.directive('signinForm', function () { var directiveDefinitionObject = { priority: 0, diff --git a/static/js/controllers.js b/static/js/controllers.js index ba0b31855..66909bdf9 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -16,16 +16,6 @@ $.fn.clipboardCopy = function() { }; function SigninCtrl($scope, $location, $timeout, Restangular, KeyService, UserService) { - $scope.sendRecovery = function() { - var signinPost = Restangular.one('recovery'); - signinPost.customPOST($scope.recovery).then(function() { - $scope.invalidEmail = false; - $scope.sent = true; - }, function(result) { - $scope.invalidEmail = true; - $scope.sent = false; - }); - }; }; function PlansCtrl($scope, $location, UserService, PlanService) { @@ -40,8 +30,11 @@ function PlansCtrl($scope, $location, UserService, PlanService) { $scope.signedIn = function() { $('#signinModal').modal('hide'); - PlanService.handleNotedPlan(); - + PlanService.handleNotedPlan(); + }; + + $scope.cancelNotedPlan = function() { + PlanService.notePlan(''); }; $scope.buyNow = function(plan) { diff --git a/static/partials/new-organization.html b/static/partials/new-organization.html index 2180834c4..de9927639 100644 --- a/static/partials/new-organization.html +++ b/static/partials/new-organization.html @@ -32,21 +32,12 @@
In order to create a new organization, you must first be signed in as the - user that will become an admin for the organization. Please sign-in if - you already have an account, or sign up on the landing - page to create a new account. + user that will become an admin for the organization.
-
-
-

Sign In

-
-
- -
-
+
diff --git a/static/partials/plans.html b/static/partials/plans.html index 2172d15bf..0a82c46a8 100644 --- a/static/partials/plans.html +++ b/static/partials/plans.html @@ -77,16 +77,12 @@