mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-22 21:21:35 +01:00
users => seats
This commit is contained in:
parent
f63f4e0aa3
commit
40d38ec0db
@ -15,7 +15,7 @@
|
||||
$scope.plan = {
|
||||
name: org.Plan,
|
||||
type: org.PlanType,
|
||||
maxUsers: org.MaxUsers
|
||||
seats: org.Seats
|
||||
};
|
||||
|
||||
$scope.subscription = {
|
||||
|
@ -15,8 +15,8 @@
|
||||
<dl>
|
||||
<dt>Name</dt>
|
||||
<dd>{{plan.name || '-'}}</dd>
|
||||
<dt>Maximum Users</dt>
|
||||
<dd>{{plan.maxUsers || '-'}}</dd>
|
||||
<dt>Total Seats</dt>
|
||||
<dd>{{plan.seats || '-'}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
|
@ -6,48 +6,51 @@
|
||||
$scope.plans = {
|
||||
free: {
|
||||
basePrice: 0,
|
||||
noAdditionalUsers: true,
|
||||
noAdditionalSeats: true,
|
||||
noPayment: true
|
||||
},
|
||||
personal: {
|
||||
basePrice: 1,
|
||||
annualBasePrice: 12,
|
||||
baseUsers: 5,
|
||||
userPrice: 1,
|
||||
annualUserPrice: 12,
|
||||
maxAdditionalUsers: 5
|
||||
baseSeats: 5,
|
||||
seatPrice: 1,
|
||||
annualSeatPrice: 12,
|
||||
maxAdditionalSeats: 5,
|
||||
annualPlanType: 'personalAnnually'
|
||||
},
|
||||
teams: {
|
||||
basePrice: 5,
|
||||
annualBasePrice: 60,
|
||||
monthlyBasePrice: 8,
|
||||
baseUsers: 5,
|
||||
userPrice: 2,
|
||||
annualUserPrice: 24,
|
||||
monthlyUserPrice: 2.5
|
||||
baseSeats: 5,
|
||||
seatPrice: 2,
|
||||
annualSeatPrice: 24,
|
||||
monthlySeatPrice: 2.5,
|
||||
monthPlanType: 'teamsMonthly',
|
||||
annualPlanType: 'teamsAnnually'
|
||||
}
|
||||
};
|
||||
|
||||
$scope.model = {
|
||||
plan: 'free',
|
||||
additionalUsers: 0,
|
||||
additionalSeats: 0,
|
||||
interval: 'year',
|
||||
ownedBusiness: false
|
||||
};
|
||||
|
||||
$scope.totalPrice = function () {
|
||||
if ($scope.model.interval === 'month') {
|
||||
return ($scope.model.additionalUsers || 0) * $scope.plans[$scope.model.plan].monthlyUserPrice +
|
||||
return ($scope.model.additionalSeats || 0) * $scope.plans[$scope.model.plan].monthlySeatPrice +
|
||||
$scope.plans[$scope.model.plan].monthlyBasePrice;
|
||||
}
|
||||
else {
|
||||
return ($scope.model.additionalUsers || 0) * $scope.plans[$scope.model.plan].annualUserPrice +
|
||||
return ($scope.model.additionalSeats || 0) * $scope.plans[$scope.model.plan].annualSeatPrice +
|
||||
$scope.plans[$scope.model.plan].annualBasePrice;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.changedPlan = function () {
|
||||
if ($scope.model.plan !== 'teams') {
|
||||
if ($scope.plans[$scope.model.plan].hasOwnProperty('monthPlanType')) {
|
||||
$scope.model.interval = 'year';
|
||||
}
|
||||
};
|
||||
@ -75,13 +78,13 @@
|
||||
$scope.submitPromise = stripe.card.createToken(model.card).then(function (response) {
|
||||
var paidRequest = {
|
||||
name: model.name,
|
||||
planType: model.plan,
|
||||
planType: model.interval === 'month' ? $scope.plans[model.plan].monthPlanType :
|
||||
$scope.plans[model.plan].annualPlanType,
|
||||
key: shareKey,
|
||||
paymentToken: response.id,
|
||||
additionalUsers: model.additionalUsers,
|
||||
additionalSeats: model.additionalSeats,
|
||||
billingEmail: model.billingEmail,
|
||||
businessName: model.ownedBusiness ? model.businessName : null,
|
||||
monthly: model.interval === 'month'
|
||||
businessName: model.ownedBusiness ? model.businessName : null
|
||||
};
|
||||
|
||||
return apiService.organizations.post(paidRequest).$promise;
|
||||
|
@ -78,8 +78,8 @@
|
||||
<span>- Priority customer support</span>
|
||||
<span>- 7 day free trial, cancel anytime</span>
|
||||
<span class="bottom-line">
|
||||
{{plans.personal.basePrice | currency:'$'}} /month for {{plans.personal.baseUsers}} users,
|
||||
additional users {{plans.personal.userPrice | currency:'$'}} /month
|
||||
{{plans.personal.basePrice | currency:'$'}} /month for {{plans.personal.baseSeats}} users,
|
||||
additional users {{plans.personal.seatPrice | currency:'$'}} /month
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
@ -93,8 +93,8 @@
|
||||
<span>- Priority customer support</span>
|
||||
<span>- 7 day free trial, cancel anytime</span>
|
||||
<span class="bottom-line">
|
||||
{{plans.teams.basePrice | currency:'$'}} /month for {{plans.teams.baseUsers}} users,
|
||||
additional users {{plans.teams.userPrice | currency:'$'}} /month
|
||||
{{plans.teams.basePrice | currency:'$'}} /month for {{plans.teams.baseSeats}} users,
|
||||
additional users {{plans.teams.seatPrice | currency:'$'}} /month
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
@ -105,25 +105,25 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box box-default" ng-if="!plans[model.plan].noAdditionalUsers">
|
||||
<div class="box box-default" ng-if="!plans[model.plan].noAdditionalSeats">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Additional Users</h3>
|
||||
<h3 class="box-title">Additional Users (Seats)</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>
|
||||
Your plan comes with <b>{{plans[model.plan].baseUsers}}</b> users. You can add additional users
|
||||
<span ng-if="plans[model.plan].maxAdditionalUsers">
|
||||
(up to {{plans[model.plan].maxAdditionalUsers}} more)
|
||||
Your plan comes with <b>{{plans[model.plan].baseSeats}}</b> users (seats). You can add additional users
|
||||
<span ng-if="plans[model.plan].maxAdditionalSeats">
|
||||
(up to {{plans[model.plan].maxAdditionalSeats}} more)
|
||||
</span>
|
||||
for {{plans[model.plan].userPrice | currency:'$'}} per user /month.
|
||||
for {{plans[model.plan].seatPrice | currency:'$'}} per user /month.
|
||||
</p>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group" show-errors style="margin: 0;">
|
||||
<label for="additionalUsers" class="sr-only">Additional Users</label>
|
||||
<input type="number" id="additionalUsers" name="AdditionalUsers" ng-model="model.additionalUsers"
|
||||
<label for="additionalSeats" class="sr-only">Additional Users</label>
|
||||
<input type="number" id="additionalSeats" name="AdditionalSeats" ng-model="model.additionalSeats"
|
||||
min="0" ng- class="form-control" placeholder="# of users" api-field
|
||||
ng-attr-max="{{plans[model.plan].maxAdditionalUsers || 1000000}}" />
|
||||
ng-attr-max="{{plans[model.plan].maxAdditionalSeats || 1000000}}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -145,8 +145,8 @@
|
||||
</span>
|
||||
<span>
|
||||
Additional users:
|
||||
{{model.additionalUsers || 0}} ×{{plans[model.plan].userPrice | currency:"$":2}}
|
||||
×12 mo. = {{(model.additionalUsers * plans[model.plan].annualUserPrice) | currency:"$":2}} /year
|
||||
{{model.additionalSeats || 0}} ×{{plans[model.plan].seatPrice | currency:"$":2}}
|
||||
×12 mo. = {{(model.additionalSeats * plans[model.plan].annualSeatPrice) | currency:"$":2}} /year
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
@ -160,8 +160,8 @@
|
||||
</span>
|
||||
<span>
|
||||
Additional users:
|
||||
{{model.additionalUsers || 0}} ×{{plans[model.plan].monthlyUserPrice | currency:"$":2}} =
|
||||
{{(model.additionalUsers * plans[model.plan].monthlyUserPrice) | currency:"$":2}} /month
|
||||
{{model.additionalSeats || 0}} ×{{plans[model.plan].monthlySeatPrice | currency:"$":2}} =
|
||||
{{(model.additionalSeats * plans[model.plan].monthlySeatPrice) | currency:"$":2}} /month
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user