mirror of
https://github.com/bitwarden/browser.git
synced 2025-02-11 00:31:45 +01:00
premium required messages
This commit is contained in:
parent
8df16f28e7
commit
dfd791ecf9
@ -77,6 +77,7 @@ angular.module('bit')
|
|||||||
description: 'Verification codes will be emailed to you.',
|
description: 'Verification codes will be emailed to you.',
|
||||||
enabled: false,
|
enabled: false,
|
||||||
active: true,
|
active: true,
|
||||||
|
free: true,
|
||||||
image: 'gmail.png',
|
image: 'gmail.png',
|
||||||
displayOrder: 4,
|
displayOrder: 4,
|
||||||
priority: 0
|
priority: 0
|
||||||
|
17
src/app/global/premiumRequiredController.js
Normal file
17
src/app/global/premiumRequiredController.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
angular
|
||||||
|
.module('bit.global')
|
||||||
|
|
||||||
|
.controller('premiumRequiredController', function ($scope, $state, $uibModalInstance, $analytics) {
|
||||||
|
$analytics.eventTrack('premiumRequiredController', { category: 'Modal' });
|
||||||
|
|
||||||
|
$scope.go = function () {
|
||||||
|
$analytics.eventTrack('Get Premium');
|
||||||
|
$state.go('backend.user.settingsPremium').then(function () {
|
||||||
|
$scope.close();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.close = function () {
|
||||||
|
$uibModalInstance.dismiss('close');
|
||||||
|
};
|
||||||
|
});
|
@ -2,23 +2,40 @@
|
|||||||
.module('bit.settings')
|
.module('bit.settings')
|
||||||
|
|
||||||
.controller('settingsTwoStepController', function ($scope, apiService, toastr, $analytics, constants,
|
.controller('settingsTwoStepController', function ($scope, apiService, toastr, $analytics, constants,
|
||||||
$filter, $uibModal) {
|
$filter, $uibModal, authService) {
|
||||||
$scope.providers = constants.twoFactorProviderInfo;
|
$scope.providers = constants.twoFactorProviderInfo;
|
||||||
|
$scope.premium = true;
|
||||||
|
|
||||||
apiService.twoFactor.list({}, function (response) {
|
authService.getUserProfile().then(function (profile) {
|
||||||
for (var i = 0; i < response.Data.length; i++) {
|
$scope.premium = profile.premium;
|
||||||
if (!response.Data[i].Enabled) {
|
return apiService.twoFactor.list({}).$promise;
|
||||||
continue;
|
}).then(function (response) {
|
||||||
}
|
if (response.Data) {
|
||||||
|
for (var i = 0; i < response.Data.length; i++) {
|
||||||
|
if (!response.Data[i].Enabled) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
var provider = $filter('filter')($scope.providers, { type: response.Data[i].Type });
|
var provider = $filter('filter')($scope.providers, { type: response.Data[i].Type });
|
||||||
if (provider.length) {
|
if (provider.length) {
|
||||||
provider[0].enabled = true;
|
provider[0].enabled = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.edit = function (provider) {
|
$scope.edit = function (provider) {
|
||||||
|
if (!$scope.premium && !provider.free) {
|
||||||
|
$uibModal.open({
|
||||||
|
animation: true,
|
||||||
|
templateUrl: 'app/views/premiumRequired.html',
|
||||||
|
controller: 'premiumRequiredController'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (provider.type === constants.twoFactorProvider.authenticator) {
|
if (provider.type === constants.twoFactorProvider.authenticator) {
|
||||||
typeName = 'Authenticator';
|
typeName = 'Authenticator';
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<ul class="fa-ul">
|
<ul class="fa-ul">
|
||||||
<li>
|
<li>
|
||||||
<i class="fa-li fa fa-check text-green"></i>
|
<i class="fa-li fa fa-check text-green"></i>
|
||||||
1 GB of encrypted file storage
|
1 GB of encrypted file storage.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<i class="fa-li fa fa-check text-green"></i>
|
<i class="fa-li fa fa-check text-green"></i>
|
||||||
|
@ -25,14 +25,17 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="provider in providers | orderBy: 'displayOrder'">
|
<tr ng-repeat="provider in providers | orderBy: 'displayOrder'">
|
||||||
<td style="width: 120px; height: 75px;" align="center">
|
<td style="width: 120px; height: 75px;" align="center">
|
||||||
<img alt="{{::provider.name}}" ng-src="{{'images/two-factor/' + provider.image}}" />
|
<a href="#" stop-click ng-click="edit(provider)">
|
||||||
|
<img alt="{{::provider.name}}" ng-src="{{'images/two-factor/' + provider.image}}" />
|
||||||
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="#" stop-click ng-click="edit(provider)">{{::provider.name}}</a>
|
<a href="#" stop-click ng-click="edit(provider)">{{::provider.name}}</a>
|
||||||
|
<span class="label label-info" ng-if="!premium && !provider.free">PREMIUM</span>
|
||||||
<div class="text-muted text-sm">{{::provider.description}}</div>
|
<div class="text-muted text-sm">{{::provider.description}}</div>
|
||||||
</td>
|
</td>
|
||||||
<td style="width: 100px;" class="text-right">
|
<td style="width: 100px;" class="text-right">
|
||||||
<span class="label"
|
<span class="label label-full"
|
||||||
ng-class="{ 'label-success': provider.enabled, 'label-default': !provider.enabled }">
|
ng-class="{ 'label-success': provider.enabled, 'label-default': !provider.enabled }">
|
||||||
{{provider.enabled ? 'Enabled' : 'Disabled'}}
|
{{provider.enabled ? 'Enabled' : 'Disabled'}}
|
||||||
</span>
|
</span>
|
||||||
|
@ -200,22 +200,35 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.attachments = function (login) {
|
$scope.attachments = function (login) {
|
||||||
if (!cryptoService.getEncKey()) {
|
authService.getUserProfile().then(function (profile) {
|
||||||
toastr.error('You cannot use this feature until you update your encryption key.', 'Feature Unavailable');
|
return profile.premium;
|
||||||
return;
|
}).then(function (isPremium) {
|
||||||
}
|
if (!isPremium) {
|
||||||
|
$uibModal.open({
|
||||||
var addModel = $uibModal.open({
|
animation: true,
|
||||||
animation: true,
|
templateUrl: 'app/views/premiumRequired.html',
|
||||||
templateUrl: 'app/vault/views/vaultAttachments.html',
|
controller: 'premiumRequiredController'
|
||||||
controller: 'vaultAttachmentsController',
|
});
|
||||||
resolve: {
|
return;
|
||||||
loginId: function () { return login.id; }
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
addModel.result.then(function (data) {
|
if (!cryptoService.getEncKey()) {
|
||||||
|
toastr.error('You cannot use this feature until you update your encryption key.', 'Feature Unavailable');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var addModel = $uibModal.open({
|
||||||
|
animation: true,
|
||||||
|
templateUrl: 'app/vault/views/vaultAttachments.html',
|
||||||
|
controller: 'vaultAttachmentsController',
|
||||||
|
resolve: {
|
||||||
|
loginId: function () { return login.id; }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
addModel.result.then(function (data) {
|
||||||
|
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
36
src/app/views/premiumRequired.html
Normal file
36
src/app/views/premiumRequired.html
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" ng-click="close()" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
|
<h4 class="modal-title"><i class="fa fa-star"></i> Premium <span class="hidden-xs">Membership</span> Required</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<p>This features requires a premium membership. Sign up for premium and get:</p>
|
||||||
|
<ul class="fa-ul">
|
||||||
|
<li>
|
||||||
|
<i class="fa-li fa fa-check text-green"></i>
|
||||||
|
1 GB of encrypted file storage.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa-li fa fa-check text-green"></i>
|
||||||
|
Additional two-step login options such as YubiKey, FIDO U2F, and Duo.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa-li fa fa-check text-green"></i>
|
||||||
|
TOTP verification code (2FA) generator for logins in your vault.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa-li fa fa-check text-green"></i>
|
||||||
|
Priority customer support.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa-li fa fa-check text-green"></i>
|
||||||
|
All future premium features. More coming soon!
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
All for just <b>{{10 | currency:"$":0}}</b> /year.
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="submit" class="btn btn-primary btn-flat" ng-click="go()">
|
||||||
|
Get Premium
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
|
||||||
|
</div>
|
@ -143,6 +143,7 @@
|
|||||||
<script src="app/global/topNavController.js"></script>
|
<script src="app/global/topNavController.js"></script>
|
||||||
<script src="app/global/sideNavController.js"></script>
|
<script src="app/global/sideNavController.js"></script>
|
||||||
<script src="app/global/appsController.js"></script>
|
<script src="app/global/appsController.js"></script>
|
||||||
|
<script src="app/global/premiumRequiredController.js"></script>
|
||||||
|
|
||||||
<script src="app/accounts/accountsModule.js"></script>
|
<script src="app/accounts/accountsModule.js"></script>
|
||||||
<script src="app/accounts/accountsLoginController.js"></script>
|
<script src="app/accounts/accountsLoginController.js"></script>
|
||||||
|
@ -261,6 +261,7 @@ form .btn .loading-icon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Forms */
|
/* Forms */
|
||||||
|
|
||||||
.form-control {
|
.form-control {
|
||||||
border-radius: 0 !important;
|
border-radius: 0 !important;
|
||||||
}
|
}
|
||||||
@ -353,11 +354,6 @@ form .btn .loading-icon {
|
|||||||
vertical-align: middle !important;
|
vertical-align: middle !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table td .label {
|
|
||||||
font-size: 85%;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
.box-header.with-border + .box-body .table > tbody > tr:first-child > td {
|
.box-header.with-border + .box-body .table > tbody > tr:first-child > td {
|
||||||
border-top: 0;
|
border-top: 0;
|
||||||
}
|
}
|
||||||
@ -623,3 +619,8 @@ h1, h2, h3, h4, h5, h6 {
|
|||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.label-full {
|
||||||
|
font-size: 85%;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user