Merge pull request #2028 from matiu/v0.8.3

V0.8.3
This commit is contained in:
Matias Alejo Garcia 2014-12-06 18:25:55 -03:00
commit 418bbc7c43
12 changed files with 66 additions and 82 deletions

View file

@ -62,7 +62,7 @@
<section class="left-small"> <section class="left-small">
<a class="left-off-canvas-toggle menu-icon" ><span></span></a> <a class="left-off-canvas-toggle menu-icon" ><span></span></a>
</section> </section>
<section class="right-small"> <section class="right-small" ng-if="$root.iden && $root.iden.listWallets().length >1">
<a class="right-off-canvas-toggle p10"><i class="icon-wallet size-24"></i></a> <a class="right-off-canvas-toggle p10"><i class="icon-wallet size-24"></i></a>
</section> </section>
@ -77,7 +77,7 @@
<div ng-include="'views/includes/sidebar-mobile.html'"></div> <div ng-include="'views/includes/sidebar-mobile.html'"></div>
</aside> </aside>
<aside class="right-off-canvas-menu"> <aside class="right-off-canvas-menu" ng-if="$root.iden && $root.iden.listWallets().length >1">
<div ng-include="'views/includes/walletbar-mobile.html'"></div> <div ng-include="'views/includes/walletbar-mobile.html'"></div>
</aside> </aside>
<div <div

View file

@ -117,8 +117,8 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
// mobile // mobile
if ($scope.isMobile) { if ($scope.isMobile) {
_credentials = { _credentials = {
email: form.email.$modelValue, email: emailOrUsername,
password: form.password.$modelValue, password: password,
}; };
$scope.askForPin = 1; $scope.askForPin = 1;
$rootScope.hideNavigation = true; $rootScope.hideNavigation = true;

View file

@ -2,6 +2,10 @@
angular.module('copayApp.controllers').controller('HomeController', function($scope, $rootScope, $location, $timeout, notification, identityService, Compatibility, pinService, applicationService, isMobile) { angular.module('copayApp.controllers').controller('HomeController', function($scope, $rootScope, $location, $timeout, notification, identityService, Compatibility, pinService, applicationService, isMobile) {
// Global functions (TODO should be somewhere else)
$rootScope.go = function (path) {
$location.path(path);
};
var _credentials, _firstpin; var _credentials, _firstpin;
$scope.init = function() { $scope.init = function() {
@ -56,21 +60,6 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
} }
}); });
$scope.done = function() {
$rootScope.starting = false;
$rootScope.$digest();
};
$scope.$on("$destroy", function() {
var iden = $rootScope.iden;
if (iden) {
iden.removeListener('newWallet', $scope.done);
iden.removeListener('noWallets', $scope.done);
}
});
$scope.openWithPin = function(pin) { $scope.openWithPin = function(pin) {
if (!pin) { if (!pin) {
@ -92,11 +81,8 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
$scope.openWallets = function() { $scope.openWallets = function() {
preconditions.checkState($rootScope.iden); preconditions.checkState($rootScope.iden);
var iden = $rootScope.iden; var iden = $rootScope.iden;
$rootScope.hideNavigation = false; $rootScope.hideNavigation = false;
$rootScope.starting = true; $rootScope.starting = true;
iden.on('newWallet', $scope.done);
iden.on('noWallets', $scope.done);
iden.openWallets(); iden.openWallets();
}; };
@ -169,7 +155,6 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
// mobile // mobile
if ($scope.isMobile && !$rootScope.hasPin) { if ($scope.isMobile && !$rootScope.hasPin) {
$scope.done();
_credentials = { _credentials = {
email: email, email: email,
password: password, password: password,

View file

@ -68,7 +68,7 @@ angular.module('copayApp.controllers').controller('HomeWalletController', functi
removeWatch(); removeWatch();
w.removeListener('txProposalEvent', _updateTxs); w.removeListener('txProposalEvent', _updateTxs);
}; };
}); });
$scope.setAlternativeAmount = function(w, tx, cb) { $scope.setAlternativeAmount = function(w, tx, cb) {
rateService.whenAvailable(function() { rateService.whenAvailable(function() {

View file

@ -89,14 +89,14 @@ angular.module('copayApp.controllers').controller('SettingsController', function
}), }),
}, },
function() { function() {
notification.success('Settings saved'); notification.success('Settings saved',"Settings were saved");
$location.path('/'); $location.path('/');
}); });
}; };
$scope.reset = function() { $scope.reset = function() {
configService.reset(function() { configService.reset(function() {
notification.success('Settings reseted'); notification.success('Settings reseted',"Settings were reseted");
$location.path('/'); $location.path('/');
}); });
}; };

View file

@ -26,10 +26,6 @@ angular.module('copayApp.controllers').controller('SidebarController', function(
'link': 'more' 'link': 'more'
}]; }];
$scope.go = function (path) {
$location.path(path);
};
$scope.signout = function() { $scope.signout = function() {
$rootScope.signingOut = true; $rootScope.signingOut = true;
identityService.signout(); identityService.signout();

View file

@ -31,6 +31,7 @@ angular.module('copayApp.services')
root.goWalletHome = function() { root.goWalletHome = function() {
var w = $rootScope.wallet; var w = $rootScope.wallet;
if (w) { if (w) {
$rootScope.starting = false;
if (!w.isComplete()) { if (!w.isComplete()) {
$location.path('/copayers'); $location.path('/copayers');
} else { } else {
@ -233,7 +234,7 @@ angular.module('copayApp.services')
w.on('txProposalEvent', function(e) { w.on('txProposalEvent', function(e) {
if (root.isFocused(wid)) { if (root.isFocused(wid)) {
pendingTxsService.update(); pendingTxsService.update();
} }
balanceService.update(w, function() { balanceService.update(w, function() {
@ -288,7 +289,6 @@ angular.module('copayApp.services')
var self = this; var self = this;
root.setupGlobalVariables(iden); root.setupGlobalVariables(iden);
iden.on('newWallet', function(wid) { iden.on('newWallet', function(wid) {
var w = iden.getWalletById(wid); var w = iden.getWalletById(wid);
copay.logger.debug('newWallet:', w.getName(), wid, iden.getLastFocusedWalletId()); copay.logger.debug('newWallet:', w.getName(), wid, iden.getLastFocusedWalletId());
@ -298,20 +298,25 @@ angular.module('copayApp.services')
root.setFocusedWallet(w, true); root.setFocusedWallet(w, true);
root.goWalletHome(); root.goWalletHome();
} }
// At the end (after all handlers are in place)...start the wallet. // At the end (after all handlers are in place)...start the wallet.
w.netStart(); w.netStart();
}); });
iden.on('noWallets', function() { iden.on('noWallets', function() {
notification.warning('No Wallets','Your profile has no wallets. Create one here');
$rootScope.starting = false;
$location.path('/create'); $location.path('/create');
$rootScope.$digest() $timeout(function() {
$rootScope.$digest();
}, 1);
}); });
iden.on('walletDeleted', function(wid) { iden.on('walletDeleted', function(wid) {
// do nothing. this is handled 'on sync' on controller. // do nothing. this is handled 'on sync' on controller.
}); });
iden.on('walletStorageError', function (wid, message) { iden.on('walletStorageError', function(wid, message) {
notification.error('Error storing wallet', message); notification.error('Error storing wallet', message);
}); });

View file

@ -20,8 +20,8 @@
</div> </div>
</div> </div>
<div class="large-4 large-centered medium-6 medium-centered columns m20b" ng-show="!loading && !askForPin"> <div class="large-5 large-centered medium-6 medium-centered columns m20b" ng-show="!loading && !askForPin">
<div class="logo-setup"> <div class="logo-setup hide-for-small-only">
<img src="img/logo-negative-beta.svg" alt="Copay" width="100"> <img src="img/logo-negative-beta.svg" alt="Copay" width="100">
<div ng-include="'views/includes/version.html'"></div> <div ng-include="'views/includes/version.html'"></div>
</div> </div>
@ -64,7 +64,7 @@
</tab> </tab>
<tab style="width: 50%;" select="selectStorage('local')"> <tab style="width: 50%;" select="selectStorage('local')">
<tab-heading> <tab-heading>
<div class="m5t text-bold">In this Device </div> <div class="m5t text-bold">On this Device </div>
</tab-heading> </tab-heading>
<div class="content-item"> <div class="content-item">
<div class="bg-circle"><i class="icon-locked"></i> <div class="bg-circle"><i class="icon-locked"></i>
@ -86,7 +86,7 @@
<button translate class="button primary radius expand m0" ng-click="goToEmail()"> <button translate class="button primary radius expand m0" ng-click="goToEmail()">
<span ng-if="!useLocalstorage"> Create in the cloud</span> <span ng-if="!useLocalstorage"> Create in the cloud</span>
<span ng-if="useLocalstorage"> Create in this device</span> <span ng-if="useLocalstorage"> Create on this device</span>
</button> </button>
<div class="box-setup-footer"> <div class="box-setup-footer">
@ -113,8 +113,8 @@
<img src="img/clipo-signup2.png" alt="clipo" width="373"> <img src="img/clipo-signup2.png" alt="clipo" width="373">
</div> </div>
<h2 ng-if="useLocalstorage"> Creating in this device </h2>
<h2 ng-if="!useLocalstorage"> Creating in the cloud </h2> <h2 ng-if="!useLocalstorage"> Creating in the cloud </h2>
<h2 ng-if="useLocalstorage"> Creating on this device </h2>
<div class="input" ng-if="useEmail"> <div class="input" ng-if="useEmail">
<input type="email" ng-model="email" class="form-control fi-email" name="email" placeholder="Email" required auto-focus="!isMobile"> <input type="email" ng-model="email" class="form-control fi-email" name="email" placeholder="Email" required auto-focus="!isMobile">
@ -158,7 +158,7 @@
<img src="img/clipo-signup3.png" alt="clipo" width="380"> <img src="img/clipo-signup3.png" alt="clipo" width="380">
</div> </div>
<h2 ng-if="useLocalstorage"> Creating in this device </h2> <h2 ng-if="useLocalstorage"> Creating on this device </h2>
<h2 ng-if="!useLocalstorage"> Creating in the cloud </h2> <h2 ng-if="!useLocalstorage"> Creating in the cloud </h2>
<div class="text-gray text-center m20b"> {{userOrEmail}} </div> <div class="text-gray text-center m20b"> {{userOrEmail}} </div>

View file

@ -20,7 +20,7 @@
</div> </div>
</div> </div>
<div class="large-4 large-centered medium-7 medium-centered columns" ng-show="!$root.starting"> <div class="large-5 large-centered medium-7 medium-centered columns" ng-show="!$root.starting">
<div class="logo-setup" ng-show="!$root.iden"> <div class="logo-setup" ng-show="!$root.iden">
<img src="img/logo-negative-beta.svg" alt="Copay" width="100"> <img src="img/logo-negative-beta.svg" alt="Copay" width="100">
<div ng-include="'views/includes/version.html'"></div> <div ng-include="'views/includes/version.html'"></div>
@ -111,7 +111,7 @@
</form> </form>
</div> </div>
<div ng-if='!$root.hasPin && !askForPin'> <div ng-if='!$root.hasPin && !askForPin && !$root.iden'>
<div class="clipo"> <div class="clipo">
<img src="img/clipo-signin.png" alt="clipo" width="310"> <img src="img/clipo-signin.png" alt="clipo" width="310">
</div> </div>
@ -122,7 +122,7 @@
</div> </div>
<b>Copay now needs a profile to access wallets.</b> <b>Copay now needs a profile to access wallets.</b>
You can import your current wallets after You can import your current wallets after
<a class="text-white" href="#!/createProfile">creating your profile</a> <a class="text-white" ng-click="$root.go('/createProfile')">creating your profile</a>
</div> </div>
<div class="p10 box-setup bg-success m20b text-white" ng-show="pendingPayment"> <div class="p10 box-setup bg-success m20b text-white" ng-show="pendingPayment">
<div class="left"> <div class="left">
@ -162,22 +162,24 @@
<div class="box-setup-footer"> <div class="box-setup-footer">
<div class="right">
<a class="button-setup text-gray" ng-click="$root.go('/settings')">
<i class="icon-wrench"></i>
<span translate>Settings</span>
</a>
</div>
<div class="left m10r"> <div class="left m10r">
<a class="button-setup text-gray" href="#!/createProfile"> <a class="button-setup text-gray" ng-click="$root.go('/createProfile')">
<i class="icon-person"></i> <i class="icon-person"></i>
<span translate>Create a profile</span> <span translate>Create profile</span>
</a> </a>
</div> </div>
<div class="left"> <div class="left">
<a class="button-setup text-gray" href="#!/importProfile"> <a class="button-setup text-gray" ng-click="$root.go('/importProfile')">
<i class="icon-upload"></i> <i class="icon-upload"></i>
<span translate>Import a profile</span> <span translate>Import</span>
</a>
</div>
<div class="right m10t">
<a class="text-gray" href="#!/settings">
<i class="icon-wrench"></i>
<span translate>Settings</span>
</a> </a>
</div> </div>
</div> </div>

View file

@ -1,6 +1,6 @@
<div class="row collapse"> <div class="row collapse">
<div class="medium-3 small-3 columns text-center bottombar-item" ng-repeat="item in menu" ui-route="{{item.link}}" ng-if="item.link!='more'"> <div class="medium-3 small-3 columns text-center bottombar-item" ng-repeat="item in menu" ui-route="{{item.link}}" ng-if="item.link!='more'">
<a ng-click="go(item.link)" ng-class="{active: isActive(item)}"> <a ng-click="$root.go(item.link)" ng-class="{active: isActive(item)}">
<i class="size-36 {{item.icon}} db"></i> <i class="size-36 {{item.icon}} db"></i>
<div class="size-10 tu"> <div class="size-10 tu">
{{item.title}} {{item.title}}

View file

@ -1,38 +1,39 @@
<div> <div>
<div class="text-center off-canvas-list">
<a href="#!/profile" class="columns m10v" title="Profile">
<div class="photo-container">
<img gravatar-src="'{{$root.iden.getName()}}'" gravatar-size="35">
</div>
<p class="text-black m5">{{$root.iden.getName()}}</p>
<span class="db text-gray size-10" >
<i class="fi-torso"></i> {{'ViewProfile' | translate }}
</span>
</a>
</div>
<ul class="off-canvas-list"> <ul class="off-canvas-list">
<li> <li>
<a href="#!/create" class="db p20h nav-item" title="Create new wallet"> <a href="#!/profile" class="db p20h nav-item text-center" title="Create new wallet">
<i class="size-24 m20r fi-plus"></i> {{'Create new wallet' | translate }} </a> <div class="photo-container m20t">
<img gravatar-src="'{{$root.iden.getName()}}'" gravatar-size="35">
</div>
<p class="text-black m5">{{$root.iden.getName()}}</p>
<span class="db text-gray size-10">
<i class="fi-torso"></i> {{'ViewProfile' | translate }}
</span>
</a>
</li> </li>
<li> <li>
<a href="#!/join" class="db p20h nav-item" title="Join shared wallet"> <a href="#!/create" class="db p20h nav-item" title="Create new wallet">
<i class="size-24 m20r fi-torsos-all"></i> {{'Join shared wallet' | translate }} </a> <i class="size-24 m20r fi-plus"></i> {{'Create new wallet' | translate }}</a>
</li> </li>
<li> <li>
<a href="#!/import" class="db p20h nav-item" title="Import wallet"> <a href="#!/join" class="db p20h nav-item" title="Join shared wallet">
<i class="size-24 m20r fi-download"></i> {{'Import a wallet' | translate }} </a> <i class="size-24 m20r fi-torsos-all"></i> {{'Join shared wallet' | translate }}</a>
</li>
<li>
<a href="#!/import" class="db p20h nav-item" title="Import wallet">
<i class="size-24 m20r fi-download"></i> {{'Import a wallet' | translate }}</a>
</li> </li>
<li ng-if="$root.wallet"> <li ng-if="$root.wallet">
<a href="#!/more" class="db p20h nav-item" title="Settings" > <a href="#!/more" class="db p20h nav-item" title="Settings">
<i class="size-24 m20r fi-widget"></i> {{'Wallet Settings' | translate }} </a> <i class="size-24 m20r fi-widget"></i> {{'Wallet Settings' | translate }}</a>
</li> </li>
<li> <li>
<a href="#!/" class="db p20h nav-item" title="Close" <a href="#!/" class="db p20h nav-item" title="Close" ng-click="signout()">
ng-click="signout()"> <span ng-if="!$root.hasPin"><i class="size-24 m20r fi-power"></i> {{'Close'|translate}}</span>
<span ng-if="!$root.hasPin"><i class="size-24 m20r fi-power"></i> {{'Close'|translate}}</span> <span ng-if="$root.hasPin"><i class="size-24 m20r fi-lock"></i> {{'Lock'|translate}}</span>
<span ng-if="$root.hasPin"><i class="size-24 m20r fi-lock"></i> {{'Lock'|translate}}</span> </a>
</a>
</li> </li>
</ul> </ul>
<div class="text-gray size-12 text-center columns"> <div class="text-gray size-12 text-center columns">

View file

@ -2,11 +2,6 @@
<header ng-show="$root.wallet"> <header ng-show="$root.wallet">
<h1>My wallets</h1> <h1>My wallets</h1>
</header> </header>
<div class="side-nav text-center off-canvas-list" ng-show="!wallets[0]">
<p class="size-12 text-gray m10t" translate>You do not have another wallets.</p>
<a href="#!/create" class="db button secondary tiny" title="Create new wallet">
<i class="m10r fi-plus"></i> {{'Create new wallet' | translate }} </a>
</div>
<ul class="side-nav wallets off-canvas-list" ng-show="wallets[0]"> <ul class="side-nav wallets off-canvas-list" ng-show="wallets[0]">
<li <li
ng-repeat="item in wallets track by $index" ng-repeat="item in wallets track by $index"