From 8098ab50e83c4761b3f1607ff31c3d61a7099223 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 4 Apr 2017 12:57:31 -0400 Subject: [PATCH] organization signup plan details --- .../settingsCreateOrganizationController.js | 46 +- .../views/settingsCreateOrganization.html | 734 ++++++++++-------- 2 files changed, 438 insertions(+), 342 deletions(-) diff --git a/src/app/settings/settingsCreateOrganizationController.js b/src/app/settings/settingsCreateOrganizationController.js index 5b7e7a65521..d590b9b4f80 100644 --- a/src/app/settings/settingsCreateOrganizationController.js +++ b/src/app/settings/settingsCreateOrganizationController.js @@ -1,37 +1,65 @@ angular .module('bit.settings') - .controller('settingsCreateOrganizationController', function($scope, $state, apiService, $uibModalInstance, cryptoService, + .controller('settingsCreateOrganizationController', function ($scope, $state, apiService, $uibModalInstance, cryptoService, toastr, $analytics, authService, stripe) { $analytics.eventTrack('settingsCreateOrganizationController', { category: 'Modal' }); - $scope.model = { - plan: 'Personal' + $scope.plans = { + free: { + basePrice: 0 + }, + personal: { + basePrice: 1, + annualBasePrice: 12, + baseUsers: 3, + userPrice: 1, + annualUserPrice: 12 + }, + teams: { + basePrice: 5, + annualBasePrice: 60, + monthlyBasePrice: 8, + baseUsers: 5, + userPrice: 2, + annualUserPrice: 24, + monthlyUserPrice: 2.5 + } }; - $scope.submit = function(model) { - $scope.submitPromise = stripe.card.createToken(model.card).then(function(response) { + $scope.model = { + plan: 'personal', + additionalUsers: 0, + interval: 'annually' + }; + + $scope.submit = function (model) { + $scope.submitPromise = stripe.card.createToken(model.card).then(function (response) { var request = { name: model.name, planType: model.plan, key: cryptoService.makeShareKey(), - cardToken: response.id + cardToken: response.id, + additionalUsers: model.additionalUsers, + billingEmail: model.billingEmail, + businessName: model.ownedBusiness ? model.businessName : null, + monthly: model.interval === 'monthly' }; return apiService.organizations.post(request).$promise; - }).then(function(result) { + }).then(function (result) { $scope.model.card = null; $uibModalInstance.dismiss('cancel'); $analytics.eventTrack('Created Organization'); authService.addProfileOrganization(result); - $state.go('backend.org.dashboard', { orgId: result.Id }).then(function() { + $state.go('backend.org.dashboard', { orgId: result.Id }).then(function () { toastr.success('Your new organization is ready to go!', 'Organization Created'); }); }); }; - $scope.close = function() { + $scope.close = function () { $uibModalInstance.dismiss('cancel'); }; }); diff --git a/src/app/settings/views/settingsCreateOrganization.html b/src/app/settings/views/settingsCreateOrganization.html index f677c92593f..c3e59e5a543 100644 --- a/src/app/settings/views/settingsCreateOrganization.html +++ b/src/app/settings/views/settingsCreateOrganization.html @@ -15,347 +15,415 @@ -
-
- -

Share with up to 5 users.

-
-
- -

Share with as many users as you need.

-
+
+ + +
+
+ +
+
+ +

-
-
-
- - -
+

Choose Your Plan

+
+
+ +

Share with 1 other user.

+
+
+ +

For personal users such as families & friends.

+
+
+ +

For businesses and other large teams.

-
    -
  • -
  • -
  • -
  • -
  • -
  • -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
+
+
+

Additional Users

+

+ Your plan comes with {{plans[model.plan].baseUsers}} users. You can add additional users to your plan + for ${{plans[model.plan].userPrice}} /month. +

+
+ +
-
-
-
- - +
+
+

Billing Totals

+
+ +

+ Base price: {{plans[model.plan].basePrice | currency:"$":2}} ×12 mo. = {{plans[model.plan].annualBasePrice | currency:"$":2}} /year
+ Additional users: {{model.additionalUsers || 0}} ×{{plans[model.plan].userPrice | currency:"$":2}} ×12 mo. = {{(model.additionalUsers * plans[model.plan].annualUserPrice) | currency:"$":2}} /year
+ Total: {{((model.additionalUsers || 0) * plans[model.plan].annualUserPrice + plans[model.plan].annualBasePrice) | currency:"USD $":2}} /year +

+
+
+ +

+ Base price: {{plans[model.plan].monthlyBasePrice | currency:"$":2}} /month
+ Additional users: {{model.additionalUsers || 0}} ×{{plans[model.plan].monthlyUserPrice | currency:"$":2}} = {{(model.additionalUsers * plans[model.plan].monthlyUserPrice) | currency:"$":2}} /month
+ Total: {{((model.additionalUsers || 0) * plans[model.plan].monthlyUserPrice + plans[model.plan].monthlyBasePrice) | currency:"USD $":2}} /month +

+
+
+
+
+

Payment Information

+
+
+
+ + +
-
-
- - +
    +
  • +
  • +
  • +
  • +
  • +
  • +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ + +