license and profile creation in the same view

This commit is contained in:
Gabriel Bazán 2015-11-16 12:00:10 -03:00
commit b1d4e6224c
5 changed files with 97 additions and 133 deletions

View file

@ -1,47 +1,71 @@
<div ng-controller="disclaimerController" ng-init="init()"> <div class="splash content text-center"
<div ng-init="init()"
ng-if="agreed && index.hasProfile" ng-controller="disclaimerController">
class="topbar-container" <div ng-if="!agreed">
ng-include="'views/includes/topbar.html'" <div class="row">
ng-init="titleSection='Terms of Use'; goBackToState = 'about'; noColor = true"> <div class="medium-centered small-centered large-centered columns">
</div> <div class="m20t">
<span class="text-bold size-16 text-white" translate>WELCOME TO COPAY</span>
<div class="content p20b" ng-class="{'disclaimer':!index.hasProfile}"> <p class="text-gray size-14 m0 text-light" translate>A multisignature bitcoin wallet</p>
<h4 class="title m0" ng-show="!index.hasProfile"> </div>
<div class="right">Copay</div> </div>
<div translate>Terms of Use</div> </div>
</h4> <div class="row">
<div class="p20h m10t"> <div class="container-image large-3 medium-3 small-3 medium-centered small-centered large-centered columns">
<p class="enable_text_select size-14"> <img src="img/icon-splash.png" alt="icon" width="100%">
<ul> </div>
<li translate>The software you are about to use functions as a free, open source, and multi-signature digital wallet.</li> <div class="row">
<li translate>The software does not constitute an account where BitPay or other third parties serve as financial intermediaries or custodians of your bitcoin.</li> <div class="scrollArea">
<li translate>While the software has undergone beta testing and continues to be improved by feedback from the open-source user and developer community, we cannot guarantee that there will be no bugs in the software.</li> <p class="enable_text_select size-14">
<li translate>You acknowledge that your use of this software is at your own discretion and in compliance with all applicable laws.</li> <ul>
<li translate>You are responsible for safekeeping your passwords, private key pairs, PINs and any other codes you use to access the software.</li> <li translate>The software you are about to use functions as a free, open source, and multi-signature digital wallet.</li>
<li translate><b>IF YOU LOSE ACCESS TO YOUR COPAY WALLET OR YOUR ENCRYPTED PRIVATE KEYS AND YOU HAVE NOT SEPARATELY STORED A BACKUP OF YOUR WALLET AND CORRESPONDING PASSWORD, YOU ACKNOWLEDGE AND AGREE THAT ANY BITCOIN YOU HAVE ASSOCIATED WITH THAT COPAY WALLET WILL BECOME INACCESSIBLE.</b></li> <li translate>The software does not constitute an account where BitPay or other third parties serve as financial intermediaries or custodians of your bitcoin.</li>
<li translate>All transaction requests are irreversible.</li> <li translate>While the software has undergone beta testing and continues to be improved by feedback from the open-source user and developer community, we cannot guarantee that there will be no bugs in the software.</li>
<li translate>The authors of the software, employees and affiliates of Bitpay, copyright holders, and BitPay, Inc. cannot retrieve your private keys or passwords if you lose or forget them and cannot guarantee transaction confirmation as they do not have control over the Bitcoin network.</li> <li translate>You acknowledge that your use of this software is at your own discretion and in compliance with all applicable laws.</li>
<li translate>To the fullest extent permitted by law, this software is provided “as is” and no representations or warranties can be made of any kind, express or implied, including but not limited to the warranties of merchantability, fitness or a particular purpose and noninfringement.</li> <li translate>You are responsible for safekeeping your passwords, private key pairs, PINs and any other codes you use to access the software.</li>
<li translate>You assume any and all risks associated with the use of the software.</li> <li translate><b>IF YOU LOSE ACCESS TO YOUR COPAY WALLET OR YOUR ENCRYPTED PRIVATE KEYS AND YOU HAVE NOT SEPARATELY STORED A BACKUP OF YOUR WALLET AND CORRESPONDING PASSWORD, YOU ACKNOWLEDGE AND AGREE THAT ANY BITCOIN YOU HAVE ASSOCIATED WITH THAT COPAY WALLET WILL BECOME INACCESSIBLE.</b></li>
<li translate>In no event shall the authors of the software, employees and affiliates of Bitpay, copyright holders, or BitPay, Inc. be held liable for any claim, damages or other liability, whether in an action of contract, tort, or otherwise, arising from, out of or in connection with the software.</li> <li translate>All transaction requests are irreversible.</li>
<li translate>We reserve the right to modify this disclaimer from time to time.</li> <li translate>The authors of the software, employees and affiliates of Bitpay, copyright holders, and BitPay, Inc. cannot retrieve your private keys or passwords if you lose or forget them and cannot guarantee transaction confirmation as they do not have control over the Bitcoin network.</li>
</ul> <li translate>To the fullest extent permitted by law, this software is provided “as is” and no representations or warranties can be made of any kind, express or implied, including but not limited to the warranties of merchantability, fitness or a particular purpose and noninfringement.</li>
</p> <li translate>You assume any and all risks associated with the use of the software.</li>
<p ng-show="lang != 'en'"> <li translate>In no event shall the authors of the software, employees and affiliates of Bitpay, copyright holders, or BitPay, Inc. be held liable for any claim, damages or other liability, whether in an action of contract, tort, or otherwise, arising from, out of or in connection with the software.</li>
<a class="center" ng-click="$root.openExternalLink('https://copay.io/disclaimer')" translate>Official English Disclaimer</a> <li translate>We reserve the right to modify this disclaimer from time to time.</li>
</p> </ul>
</p>
<div ng-show="!agreed"> </div>
<p translate>I affirm that I have read, understood, and agree with these terms.</p> </div>
<button class="black round expand" ng-click="agree()" ng-disabled="loading" translate> </div>
Agree <div class="text-center size-12 text-warning" ng-show="error && !creatingProfile">
</button> {{(error)|translate}}. <span translate>Retrying...</span>
</div> </div>
<button ng-show="agreed && !index.hasProfile" class="round expand" ng-click="agree()" translate> <div class="onGoingProcess" ng-show="creatingProfile">
Go back <div class="onGoingProcess-content" ng-style="{'background-color':'#222'}">
</button> <div class="spinner">
</div> <div class="rect1"></div>
<div class="extra-margin-bottom"></div> <div class="rect2"></div>
</div> <div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
<span translate>Creating Profile...</span>
</div>
</div>
<div class="row">
<p ng-show="lang != 'en'">
<a class="center" ng-click="$root.openExternalLink('https://copay.io/disclaimer')" translate>Official English Disclaimer</a>
</p>
</div>
<div ng-show="!agreed">
<p translate>I affirm that I have read, understood, and agree with these terms.</p>
</div>
<div class="row" ng-show="!creatingProfile">
<div class="start-button large-8 medium-8 small-8 medium-centered small-centered large-centered columns">
<button ng-click="create()" class="button black expand round size-12 text-spacing" translate>
GET STARTED
</button>
<p class="text-gray m5b size-12" translate>Already have a wallet?</p>
<button ng-click="create(true)" class="button round outline dark-gray tiny" translate>Import backup </button>
</div>
</div>
</div>
</div> </div>

View file

@ -1,43 +0,0 @@
<div class="splash content text-center"
ng-init="init()"
ng-controller="splashController">
<div ng-if="!index.hasProfile">
<div class="row">
<div class="medium-centered small-centered large-centered columns">
<div class="m20t">
<span class="text-bold size-16 text-white" translate>WELCOME TO COPAY</span>
<p class="text-gray size-14 m0 text-light" translate>A multisignature bitcoin wallet</p>
</div>
</div>
</div>
<div class="row">
<div class="container-image large-3 medium-3 small-3 medium-centered small-centered large-centered columns">
<img src="img/icon-splash.png" alt="icon" width="100%">
</div>
</div>
<div class="text-center size-12 text-warning" ng-show="error && !creatingProfile">
{{(error)|translate}}. <span translate>Retrying...</span>
</div>
<div class="onGoingProcess" ng-show="creatingProfile">
<div class="onGoingProcess-content" ng-style="{'background-color':'#222'}">
<div class="spinner">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
<span translate>Creating Profile...</span>
</div>
</div>
<div class="row" ng-show="!creatingProfile">
<div class="start-button large-8 medium-8 small-8 medium-centered small-centered large-centered columns">
<button ng-click="create()" class="button black expand round size-12 text-spacing" translate>
GET STARTED
</button>
<p class="text-gray m5b size-12" translate>Already have a wallet?</p>
<button ng-click="create(true)" class="button round outline dark-gray tiny" translate>Import backup </button>
</div>
</div>
</div>
</div>

View file

@ -7,7 +7,6 @@
font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
} }
.panel h1, .panel h2, .panel h3, .panel h4, .panel h5, .panel h6, .panel p, .panel li, .panel dl { .panel h1, .panel h2, .panel h3, .panel h4, .panel h5, .panel h6, .panel p, .panel li, .panel dl {
color: #2C3E50; color: #2C3E50;
} }
@ -1094,6 +1093,10 @@ input.ng-invalid-match, input.ng-invalid-match:focus {
} }
/*/////////////////////////////////////////////////*/ /*/////////////////////////////////////////////////*/
.scrollArea {
height: 280px;
overflow: scroll;
}
.tabbable { .tabbable {
border: 2px solid #213140; border: 2px solid #213140;

View file

@ -1,21 +1,32 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('disclaimerController', angular.module('copayApp.controllers').controller('disclaimerController',
function($scope, $timeout, storageService, applicationService, gettextCatalog, isCordova, uxLanguage) { function($scope, $timeout, $log, profileService, isCordova, storageService, gettextCatalog, uxLanguage, go) {
$scope.agree = function() { $scope.create = function(noWallet) {
$scope.creatingProfile = true;
if (isCordova) { if (isCordova) {
window.plugins.spinnerDialog.show(null, gettextCatalog.getString('Loading...'), true); window.plugins.spinnerDialog.show(null, gettextCatalog.getString('Loading...'), true);
} }
$scope.loading = true; $scope.loading = true;
$timeout(function() { $timeout(function() {
storageService.setCopayDisclaimerFlag(function(err) { storageService.setCopayDisclaimerFlag(function(err) {
$timeout(function() { if (isCordova) {
if (isCordova) { window.plugins.spinnerDialog.hide();
window.plugins.spinnerDialog.hide(); }
profileService.create({
noWallet: noWallet
}, function(err) {
if (err) {
$scope.creatingProfile = false;
$log.warn(err);
$scope.error = err;
$scope.$apply();
$timeout(function() {
$scope.create(noWallet);
}, 3000);
} }
applicationService.restart(); });
}, 1000);
}); });
}, 100); }, 100);
}; };
@ -24,6 +35,10 @@ angular.module('copayApp.controllers').controller('disclaimerController',
storageService.getCopayDisclaimerFlag(function(err, val) { storageService.getCopayDisclaimerFlag(function(err, val) {
$scope.lang = uxLanguage.currentLanguage; $scope.lang = uxLanguage.currentLanguage;
$scope.agreed = val; $scope.agreed = val;
if (profileService.profile) {
go.walletHome();
}
$timeout(function() { $timeout(function() {
$scope.$digest(); $scope.$digest();
}, 1); }, 1);

View file

@ -1,35 +0,0 @@
'use strict';
angular.module('copayApp.controllers').controller('splashController',
function($scope, $timeout, $log, profileService, storageService, go) {
$scope.create = function(noWallet) {
$scope.creatingProfile = true;
$timeout(function() {
profileService.create({
noWallet: noWallet
}, function(err) {
if (err) {
$scope.creatingProfile = false;
$log.warn(err);
$scope.error = err;
$scope.$apply();
$timeout(function() {
$scope.create(noWallet);
}, 3000);
}
});
}, 100);
};
$scope.init = function() {
storageService.getCopayDisclaimerFlag(function(err, val) {
if (!val) go.path('disclaimer');
if (profileService.profile) {
go.walletHome();
}
});
};
});