Merge pull request #2310 from cmgustavo/ux/wallet-info01

Removes "Manage wallets" and moves info to "Settings"
This commit is contained in:
Matias Alejo Garcia 2015-01-16 10:09:13 -03:00
commit 373f12c2a0
19 changed files with 288 additions and 310 deletions

View File

@ -268,15 +268,13 @@ input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill, inpu
}
.status {
-moz-box-shadow: inset 0px -1px 1px 0px rgba(159,47,34,0.30);
box-shadow: inset 0px -1px 1px 0px rgba(159,47,34,0.30);
color: #FFFFFF;
background-color: #A02F23;
position: absolute;
left: 250px;
right: 0;
bottom: 0;
padding: 10px 2rem;
padding: 10px 1rem 10px 0.5rem;
z-index: 9;
font-size: 14px;
text-align: left;
@ -284,7 +282,6 @@ input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill, inpu
}
.status-first-line {
z-index: 9;
font-size: 16px;
}
@ -414,9 +411,10 @@ input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill, inpu
a.close-notification {
position: absolute;
top: 8px;
right: 10px;
top: 0;
right: 0;
font-size: 24px;
padding: 10px;
}
.panel.last-transactions {
@ -1288,6 +1286,7 @@ label.postfix, a.postfix {
.createProfile input[type=email],
.createProfile input[type=text],
.createProfile input[type=password],
.createProfile input[type=tel],
.home input[type=email],
.home input[type=text],
.home input[type=tel],

View File

@ -50,21 +50,25 @@
<div class="off-canvas-wrap" id="off-canvas-wrap" ng-show="!signingOut">
<div class="inner-wrap">
<span class="status" ng-if="$root.needsEmailConfirmation && !$root.pleaseConfirmEmailAck">
<a class="close-notification text-white" ng-click="$root.pleaseConfirmEmailAck=true">&#215;</a>
<button class="text-white warning tiny m0 right"
ng-click="resendVerificationEmail()"
ng-disabled="loading"
ng-show="!hideReSendButton">
{{ loading ? 'Resending...' : 'Resend' }}
</button>
<i class="fi-alert size-36 left m20r"></i>
<span translate>
<strong class="size-16">Email not confirmed</strong>.<br>
Please confirm your email address using the confirmation link at the message we sent you
</span>
</span>
<span class="status" ng-if="$root.pleaseConfirmEmail">
<div class="status" ng-if="$root.needsEmailConfirmation && !$root.pleaseConfirmEmailAck">
<a class="close-notification text-white" ng-click="$root.pleaseConfirmEmailAck=true">&#215;</a>
<div class="row">
<div class="large-10 medium-9 small-12 columns m5b">
<i class="fi-alert size-36 left m20r"></i>
<strong class="size-16">Email not confirmed</strong>.<br>
Please confirm your email address using the confirmation link at the message we sent you
</div>
<div class="large-2 medium-3 small-12 columns text-center">
<button class="text-white warning tiny m0"
ng-click="resendVerificationEmail()"
ng-disabled="loading"
ng-show="!hideReSendButton">
{{ loading ? 'Resending...' : 'Resend' }}
</button>
</div>
</div>
</div>
<div class="status" ng-if="$root.pleaseConfirmEmail">
<a class="close-notification text-white" ng-click="$root.pleaseConfirmEmail=null">&#215;</a>
<i class="fi-alert size-36 left m20r"></i>
<span translate>
@ -72,11 +76,11 @@
An email was sent to {{$root.iden.getName()}}. Please follow the link on it to confirm it. Unconfirmed profiles could be deleted from server.
</span>
</span>
<span class="status" ng-if="$root.reconnecting">
</div>
<div class="status" ng-if="$root.reconnecting">
<i class="fi-loop icon-rotate"></i>
<span translate> <strong class="size-16">Network Error</strong>.<br> Attempting to reconnect..</span>
</span>
</div>
<div ng-controller="SidebarController" ng-show="$root.iden && !$root.hideNavigation && !$root.wpInputFocused">
<nav class="tab-bar">

View File

@ -1,9 +1,9 @@
'use strict';
angular.module('copayApp.controllers').controller('CopayersController',
function($scope, $rootScope, $timeout, go) {
function($scope, $rootScope, $timeout, go, identityService, notification) {
var w = $rootScope.wallet;
$scope.init = function() {
var w = $rootScope.wallet;
$rootScope.title = 'Share this secret with your copayers';
$scope.loading = false;
$scope.secret = $rootScope.wallet.getSecret();
@ -27,4 +27,25 @@ angular.module('copayApp.controllers').controller('CopayersController',
$rootScope.$digest();
}, 1);
};
$scope.deleteWallet = function() {
$scope.loading = true;
identityService.deleteWallet(w, function(err) {
if (err) {
$scope.loading = null;
$scope.error = err.message || err;
copay.logger.warn(err);
$timeout(function () { $scope.$digest(); });
} else {
$scope.loading = false;
if ($rootScope.wallet) {
go.walletHome();
}
$timeout(function() {
notification.success('Success', 'The wallet "' + (w.name || w.id) + '" was deleted');
});
}
});
};
});

View File

@ -41,13 +41,6 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
$scope.passwordStrength = null;
_firstpin = null;
$scope.setPinForm.newpin.$setViewValue('');
$scope.setPinForm.newpin.$render();
$scope.setPinForm.repeatpin.$setViewValue('');
$scope.setPinForm.repeatpin.$render();
$scope.setPinForm.$setPristine();
$scope.error = 'Entered PINs were not equal. Try again';
$timeout(function() {
$scope.$digest();
@ -79,7 +72,6 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
_credentials = null;
$scope.askForPin = 0;
$rootScope.hasPin = true;
$rootScope.starting = null;
$scope.createDefaultWallet();
});
}, 100);
@ -123,8 +115,10 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
/* Last step. Will emit after creation so the UX gets updated */
$scope.createDefaultWallet = function() {
$rootScope.hideNavigation = false;
$rootScope.starting = true;
identityService.createDefaultWallet(function(err) {
$scope.askForPin = 0;
$rootScope.starting = null;
if (err) {
var msg = err.toString();
@ -143,10 +137,8 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
preconditions.checkArgument(_.isString(password));
$rootScope.hideNavigation = false;
$rootScope.starting = true;
identityService.create(emailOrUsername, password, function(err) {
$rootScope.starting = null;
$scope.error = null;
if (err) {
var msg = err.toString();
@ -162,6 +154,7 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
} else {
// mobile
if ($scope.isMobile) {
$rootScope.starting = null;
_credentials = {
email: emailOrUsername,
password: password,
@ -206,6 +199,7 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
$scope.saveSettings(function(err) {
preconditions.checkState(!err, err);
$rootScope.starting = true;
$scope._doCreateProfile($scope.userOrEmail, form.password.$modelValue, function(err) {
$timeout(function() {

View File

@ -127,13 +127,13 @@ angular.module('copayApp.controllers').controller('JoinController',
return;
}
$scope.loading = true;
$rootScope.starting = true;
identityService.joinWallet({
secret: $scope.connectionId,
nickname: $scope.nickname,
privateHex: $scope.private,
}, function(err) {
$scope.loading = false;
$rootScope.starting = false;
if (err) {
if (err === 'joinError')
notification.error('Fatal error connecting to Insight server');

View File

@ -1,9 +1,20 @@
'use strict';
angular.module('copayApp.controllers').controller('MoreController',
function($scope, $rootScope, $location, $filter, balanceService, notification, rateService) {
function($scope, $rootScope, $location, $filter, $timeout, balanceService, notification, rateService, backupService, identityService, isMobile, isCordova, go) {
var w = $rootScope.wallet;
$scope.isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
var max = $rootScope.quotaPerItem;
$scope.isSafari = isMobile.Safari();
$scope.isCordova = isCordova;
$scope.wallet = w;
$scope.error = null;
$scope.success = null;
var bits = w.sizes().total;
w.kb = $filter('noFractionNumber')(bits / 1000, 1);
if (max) {
w.usage = $filter('noFractionNumber')(bits / max * 100, 0);
}
$rootScope.title = 'Settings';
@ -105,4 +116,34 @@ angular.module('copayApp.controllers').controller('MoreController',
}, true);
});
};
$scope.deleteWallet = function() {
$scope.loading = true;
identityService.deleteWallet(w, function(err) {
if (err) {
$scope.loading = null;
$scope.error = err.message || err;
copay.logger.warn(err);
$timeout(function () { $scope.$digest(); });
} else {
$scope.loading = false;
if ($rootScope.wallet) {
go.walletHome();
}
$timeout(function() {
notification.success('Success', 'The wallet "' + (w.name || w.id) + '" was deleted');
});
}
});
};
$scope.downloadWalletBackup = function() {
backupService.walletDownload(w);
};
$scope.viewWalletBackup = function() {
$scope.backupWalletPlainText = backupService.walletEncrypted(w);
};
});

View File

@ -1,5 +1,5 @@
'use strict';
angular.module('copayApp.controllers').controller('ProfileController', function($scope, $rootScope, $location, $modal, $filter, $timeout, backupService, identityService, isMobile, isCordova) {
angular.module('copayApp.controllers').controller('ProfileController', function($scope, $rootScope, $location, $modal, $filter, $timeout, backupService, identityService, isMobile, isCordova, notification) {
$scope.username = $rootScope.iden.getName();
$scope.isSafari = isMobile.Safari();
$scope.isCordova = isCordova;
@ -25,86 +25,21 @@ angular.module('copayApp.controllers').controller('ProfileController', function(
// no need to add event handlers here. Wallet deletion is handle by callback.
};
$scope.setWallets = function() {
if (!$rootScope.iden) return;
var wallets = $rootScope.iden.getWallets();
var max = $rootScope.quotaPerItem;
_.each(wallets, function(w) {
var bits = w.sizes().total;
w.kb = $filter('noFractionNumber')(bits / 1000, 1);
if (max) {
w.usage = $filter('noFractionNumber')(bits / max * 100, 0);
}
});
$scope.wallets = wallets;
$timeout(function(){
$scope.$digest();
})
};
$scope.deleteProfile = function() {
$scope.loading = true;
identityService.deleteProfile(function(err, res) {
$scope.loading = false;
if (err) {
log.warn(err);
notification.error('Error', 'Could not delete profile');
return;
$timeout(function () { $scope.$digest(); });
}
$location.path('/');
$timeout(function() {
notification.error('Success', 'Profile successfully deleted');
});
});
};
$scope.showWalletInfo = function(w) {
var ModalInstanceCtrl = function($scope, $modalInstance) {
if (!w) return;
$scope.isSafari = isMobile.Safari();
$scope.isCordova = isCordova;
$scope.item = w;
$scope.error = null;
$scope.success = null;
$scope.deleteWallet = function() {
$scope.loading = true;
identityService.deleteWallet($scope.item, function(err) {
if (err) {
$scope.loading = null;
$scope.error = err.message || err;
copay.logger.warn(err);
$timeout(function () { $scope.$digest(); });
} else {
$modalInstance.close($scope.item.name || $scope.item.id);
}
else {
$location.path('/');
$timeout(function() {
notification.success('Success', 'Profile successfully deleted');
});
};
$scope.downloadWalletBackup = function() {
backupService.walletDownload($scope.item);
};
$scope.viewWalletBackup = function() {
$scope.backupWalletPlainText = backupService.walletEncrypted($scope.item);
};
$scope.close = function() {
$modalInstance.dismiss('cancel');
};
};
var modalInstance = $modal.open({
templateUrl: 'views/modals/wallet-info.html',
windowClass: 'medium',
controller: ModalInstanceCtrl
});
modalInstance.result.then(function(walletName) {
$scope.loading = false;
$scope.success = 'The wallet "' + walletName + '" was deleted';
$scope.setWallets();
}
});
};
});

View File

@ -218,6 +218,9 @@ Identity.prototype.deleteWallet = function(walletId, cb) {
self.storage.removeItem(Wallet.getStorageKey(walletId), function(err) {
if (err) return cb(err);
self.emitAndKeepAlive('walletDeleted', walletId);
if (!self.walletIds.length) {
self.emitAndKeepAlive('noWallets')
}
self.store({
noWallets: true
}, cb);

View File

@ -323,7 +323,9 @@ angular.module('copayApp.services')
if ($rootScope.iden) {
$rootScope.signingOut = true;
$rootScope.iden.close(function() { // Will trigger 'closed'
$rootScope.signingOut = false;
$timeout(function() {
$rootScope.signingOut = null;
}, 100);
}); // Will trigger 'closed'
}
};

View File

@ -568,25 +568,12 @@ describe("Unit: Controllers", function() {
});
});
describe('Profile Controller', function() {
var ctrl, inScope, modalCtrl;
describe('More Controller', function() {
var ctrl, modalCtrl;
beforeEach(inject(function($controller, $rootScope) {
scope = $rootScope.$new();
ctrl = $controller('ProfileController', {
$scope: scope,
$modal: {
open: function(opts) {
inScope = $rootScope.$new();
modalCtrl = opts.controller(inScope, {
close: sinon.stub(),
});
return {
result: {
then: sinon.stub(),
}
};
},
},
ctrl = $controller('MoreController', {
$scope: scope
});
saveAsLastCall = null;
@ -595,8 +582,7 @@ describe("Unit: Controllers", function() {
it('Backup Wallet controller #download', function() {
var w = scope.wallet;
expect(saveAsLastCall).equal(null);
scope.showWalletInfo(w);
inScope.downloadWalletBackup();
scope.downloadWalletBackup();
expect(saveAsLastCall.blob.size).equal(7);
expect(saveAsLastCall.blob.type).equal('text/plain;charset=utf-8');
@ -605,8 +591,7 @@ describe("Unit: Controllers", function() {
it('Backup Wallet controller should name backup correctly for multiple copayers', function() {
var w = scope.wallet;
expect(saveAsLastCall).equal(null);
scope.showWalletInfo(w);
inScope.downloadWalletBackup();
scope.downloadWalletBackup();
expect(saveAsLastCall.filename).equal('nickname-fakeWallet-keybackup.json.aes');
});
@ -614,16 +599,14 @@ describe("Unit: Controllers", function() {
var w = scope.wallet;
expect(saveAsLastCall).equal(null);
scope.wallet.totalCopayers = 1;
scope.showWalletInfo(w);
inScope.downloadWalletBackup();
scope.downloadWalletBackup();
expect(saveAsLastCall.filename).equal('fakeWallet-keybackup.json.aes');
});
it('Delete a wallet', function() {
var w = scope.wallet;
scope.showWalletInfo(w);
inScope.deleteWallet();
scope.deleteWallet();
scope.$digest();
scope.iden.deleteWallet.calledOnce.should.equal(true);
scope.iden.deleteWallet.getCall(0).args[0].should.equal(w.getId());

View File

@ -49,6 +49,32 @@
</div>
</div>
<!-- end of row -->
<div class="row">
<div class="large-12 columns size-12">
<button class="warning" ng-show="!confirmDelete" ng-click="confirmDelete=!confirmDelete">
<i class="fi-trash"></i> Cancel
</button>
<div ng-show="confirmDelete">
<h2>Are you sure you want to cancel and delete this wallet</h2>
<div class="row">
<div class="large-6 medium-6 small-6 columns">
<button class="gray" ng-disabled="loading"
ng-click="confirmDelete=!confirmDelete">No</button>
</div>
<div class="large-6 medium-6 small-6 columns">
<button class="warning" ng-disabled="loading" ng-click="deleteWallet()">
<span ng-show="!loading">
<i class="fi-trash"></i> Yes
</span>
<span ng-show="loading">
<i class="fi-bitcoin-circle icon-rotate spinner"></i> Deleting...
</span>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="extra-margin-bottom"></div>

View File

@ -1,8 +1,8 @@
<div ng-controller="CreateController">
<div data-alert ng-show="loading">
<div ng-show="$root.starting">
<div ng-include="'views/includes/loading.html'" ng-init="title = 'Creating wallet'"></div>
</div>
<div class="setup" ng-show="!loading && !$root.starting">
<div class="setup" ng-show="!$root.starting">
<form name="setupForm" ng-submit="create(setupForm)" novalidate>
<div class="row">
<div class="large-12 columns">
@ -75,7 +75,7 @@
<div class="text-right">
<button translate type="submit" class="button primary expand m0" ng-disabled="setupForm.$invalid || loading">
<button translate type="submit" class="button primary expand m0" ng-disabled="setupForm.$invalid">
Create {{requiredCopayers}}-of-{{totalCopayers}} wallet
</button>
</div>

View File

@ -3,7 +3,7 @@
<div ng-include="'views/includes/loading.html'" ng-init="title = 'Creating profile'"></div>
</div>
<div class="large-4 large-centered medium-7 medium-centered columns m20b" ng-show="!$root.starting && !askForPin">
<div class="large-4 large-centered medium-7 medium-centered columns m20b" ng-show="!$root.starting && !askForPin">
<div class="logo-setup hide-for-small-only" ng-hide="hideForWP">
<img src="img/logo-negative-beta.svg" alt="Copay" width="100">
</div>
@ -205,39 +205,38 @@
<img src="img/clipo-pin.png" alt="clipo" width="380">
</div>
<div class="box-notification" ng-show="error && !passwordStrength">
<div class="box-notification" ng-show="error && !passwordStrength">
<div class="box-icon error">
<i class="fi-x size-24"></i>
</div>
<span class="text-warning size-14">
{{error|translate}}
</span>
{{error|translate}}
</span>
</div>
<form name="setPinForm" novalidate>
<form name="setPinForm" ng-model="setPinForm" novalidate>
<div class="input" ng-if="askForPin == 1">
<input id="newpin" type="tel" ng-model="newpin" class="form-control" ng-maxlength="4" ng-minlength="4" maxlength="4" ng-pattern="/^[0-9]{1,4}$/" placeholder="PIN" name="newpin" required show-focus="askForPin == 1 && !isWindowsPhoneApp" ng-focus="formFocus()">
<i class="icon-locked" ng-hide="isWindowsPhoneApp"></i>
<i class="icon-locked" ng-hide="isWindowsPhoneApp"></i>
</div>
<div class="input" ng-if="askForPin == 2">
<input id="repeatpin" type="tel" ng-model="repeatpin" class="form-control" ng-maxlength="4" ng-minlength="4" maxlength="4" ng-pattern="/^[0-9]{1,4}$/" placeholder="Confirm your PIN" name="repeatpin" required show-focus="askForPin == 2 && !isWindowsPhoneApp" ng-focus="formFocus()">
<i class="icon-locked" ng-hide="isWindowsPhoneApp"></i>
<input id="repeatpin" type="tel" ng-model="repeatpin" class="form-control" ng-maxlength="4" ng-minlength="4" maxlength="4" ng-pattern="/^[0-9]{1,4}$/" placeholder="Confirm your PIN" name="repeatpin" required show-focus="askForPin == 2 && !isWindowsPhoneApp" ng-focus="formFocus()">
<i class="icon-locked"></i>
</div>
<div class="box-setup-footer row collapse">
<div class="large-6 medium-6 small-6 columns">
<a class="button secondary radius m0" ng-click="createDefaultWallet()">
<span translate>Skip</span>
</a>
</div>
<div class="large-6 medium-6 small-6 columns text-right">
<button translate ng-click="createPin(setPinForm.repeatpin.$modelValue)" class="button primary radius expand m0"
ng-disabled="setPinForm.$invalid || error">
OK
</button>
</div>
<div class="box-setup-footer row collapse">
<div class="large-6 medium-6 small-6 columns">
<a class="button secondary radius m0" ng-click="createDefaultWallet()">
<span translate>Skip</span>
</a>
</div>
</form>
<div class="large-6 medium-6 small-6 columns text-right">
<button translate ng-click="createPin(setPinForm.repeatpin.$modelValue)" class="button primary radius expand m0"
ng-disabled="setPinForm.$invalid || error">
OK
</button>
</div>
</div>
</form>
</div>
</div>

View File

@ -1,11 +1,11 @@
<div ng-init="$root.title = 'Page not found'"
ng-class="{'wide-page':!$root.wallet}">
ng-class="{'wide-page':!$root.iden}">
<div class="text-center">
<img ng-show="$root.wallet" src="img/logo.svg" alt="Copay">
<img ng-show="!$root.wallet" src="img/logo-negative.svg" alt="Copay">
<img ng-show="$root.iden" src="img/logo.svg" alt="Copay">
<img ng-show="!$root.iden" src="img/logo-negative.svg" alt="Copay">
</div>
<h1 class="text-center" ng-class="{'text-white': !$root.wallet}">404</h1>
<h3 translate class="text-center" ng-class="{'text-white': !$root.wallet}">Page not found</h3>
<h1 class="text-center" ng-class="{'text-white': !$root.iden}">404</h1>
<h3 translate class="text-center" ng-class="{'text-white': !$root.iden}">Page not found</h3>
<p class="text-center"><a href="#!/">&laquo; <span translate>Back</span></a></p>
</div>
<div class="extra-margin-bottom"></div>

View File

@ -8,8 +8,8 @@
</div>
</header>
<div class="scroll-section">
<ul class="sidebar-mobile-wallets oh off-canvas-list m10b" ng-show="wallets[0]">
<li
<ul class="sidebar-mobile-wallets oh off-canvas-list m10b">
<li ng-show="wallets[0]"
ng-repeat="item in wallets track by $index"
ng-class="{'selected': item.id == $root.wallet.id}"
class="nav-item" ng-click="switchWallet(item.id)" >

View File

@ -1,9 +1,9 @@
<div class="join" ng-controller="JoinController">
<div ng-show="loading">
<div ng-show="$root.starting">
<div ng-include="'views/includes/loading.html'" ng-init="title = 'Connecting to Insight Wallet Server'"></div>
</div>
<div ng-show="!loading">
<div ng-show="!$root.starting">
<div class="row hide-for-large-up">
<div class="large-12 medium-12 small-12 columns">
<h1>{{$root.title}}</h1>
@ -73,7 +73,6 @@
</div>
</div>
</div>
<!-- End !loading -->
</div>
<div class="extra-margin-bottom"></div>

View File

@ -1,71 +0,0 @@
<div class="text-center" ng-init="isComplete = item.isComplete(); networkName = item.getNetworkName()">
<div ng-show="!confirmDelete">
<h1>{{item.name || item.id }}</h1>
<h3>
{{item.requiredCopayers}} of {{item.totalCopayers}} - {{networkName}}
, {{isComplete ? 'Complete' : 'Waiting for copayers...'}}
</h3>
<div class="m10b" ng-if="isComplete">
<b>{{item.balanceInfo.totalBalance || 0}} {{item.settings.unitName}}</b>
</div>
<div class="m20b">
Approximate size: {{item.kb}} kB
<span ng-if="item.usage">({{item.usage}}%) </span>
</div>
<div class="box-notification" ng-show="error">
<div class="box-icon error">
<i class="fi-x size-24"></i>
</div>
<span class="text-warning size-14">
{{error|translate}}
</span>
</div>
<div class="row" ng-show="!backupWalletPlainText && !error">
<div class="large-6 medium-6 small-12 columns">
<button class="primary expand" ng-click="downloadWalletBackup()" ng-disabled="loading"
ng-show="!isSafari && !isCordova"><i class="fi-download"></i> Download backup</button>
<button class="primary expand" ng-click="viewWalletBackup()" ng-disabled="loading"
ng-show="isSafari || isCordova"><i class="fi-eye"></i> View Backup</button>
</div>
<div class="large-6 medium-6 small-12 columns">
<button class="warning expand" ng-click="confirmDelete=!confirmDelete">
<i class="fi-trash"></i> Delete
</button>
</div>
</div>
<div ng-show="backupWalletPlainText">
<h3>Copy backup in a safe place</h3>
<div class="input">
<textarea class="show-for-large-up" readonly rows="7">{{backupWalletPlainText}}</textarea>
<textarea class="hide-for-large-up" rows="12">{{backupWalletPlainText}}</textarea>
<i class="icon-compose"></i>
</div>
<div translate class="m10t size-12 text-gray text-right">
Copy this text as it is in a safe place (notepad or email)
</div>
</div>
<a class="close-reveal-modal" ng-click="close()"><i class="fi-x size-18"></i></a>
</div>
<div class="row" ng-show="confirmDelete">
<h1>Are you sure you want to delete the wallet
<strong>{{(item.name || item.id)}}</strong>
</h1>
<div class="large-6 medium-6 small-6 columns">
<button class="gray" ng-disabled="loading"
ng-click="confirmDelete=!confirmDelete">Cancel</button>
</div>
<div class="large-6 medium-6 small-6 columns">
<button class="warning" ng-disabled="loading" ng-click="deleteWallet()">
<span ng-show="!loading">
<i class="fi-trash"></i> Delete
</span>
<span ng-show="loading">
<i class="fi-bitcoin-circle icon-rotate spinner"></i> Deleting...
</span>
</button>
</div>
</div>
</div>

View File

@ -22,7 +22,58 @@
</div>
</div>
</form>
<div class="row" ng-init="isComplete = wallet.isComplete(); networkName = wallet.getNetworkName()">
<div class="large-12 columns">
<h4>Wallet info</h4>
<table>
<tr>
<td><strong>Name:</strong></td>
<td>{{wallet.name || wallet.id }}</td>
</tr>
<tr>
<td><strong>Status:</strong></td>
<td>{{isComplete ? 'Complete' : 'Waiting for copayers...'}}</td>
</tr>
<tr>
<td><strong>Type:</strong></td>
<td>{{wallet.requiredCopayers}} of {{wallet.totalCopayers}} - {{networkName}}</td>
</tr>
<tr>
<td><strong>Balance:</strong></td>
<td><span ng-if="isComplete">{{wallet.balanceInfo.totalBalance || 0}} {{wallet.settings.unitName}}</span></td>
</tr>
<tr>
<td><strong>Aprox. size:</strong></td>
<td>{{wallet.kb}} kB <span ng-if="wallet.usage">({{wallet.usage}}%)</span></td>
</tr>
</table>
</div>
</div>
<div class="row" ng-show="!backupWalletPlainText && !error">
<div class="large-12 medium-12 small-12 columns">
<button class="primary expand" ng-click="downloadWalletBackup()" ng-disabled="loading"
ng-show="!isSafari && !isCordova"><i class="fi-download"></i> Download backup</button>
<button class="primary expand" ng-click="viewWalletBackup()" ng-disabled="loading"
ng-show="isSafari || isCordova"><i class="fi-eye"></i> View Backup</button>
</div>
</div>
<div class="row" ng-show="backupWalletPlainText">
<div class="large-12 columns">
<h3>Copy backup in a safe place</h3>
<div class="input">
<textarea class="show-for-large-up" readonly rows="7">{{backupWalletPlainText}}</textarea>
<textarea class="hide-for-large-up" rows="12">{{backupWalletPlainText}}</textarea>
<i class="icon-compose"></i>
</div>
<div translate class="m10t size-12 text-gray text-right">
Copy this text as it is in a safe place (notepad or email)
</div>
</div>
</div>
<div class="m20b row">
<div class="large-12 columns">
<a class="small left button-setup" ng-click="hideAdv=!hideAdv">
@ -37,6 +88,45 @@
</div>
<div ng-hide="hideAdv" class="row">
<div class="large-12 columns">
<div class="panel">
<h2><i class="fi-minus-circle m10r"></i>
<span translate>Delete wallet</span>
</h2>
<div class="box-notification" ng-show="error">
<div class="box-icon error">
<i class="fi-x size-24"></i>
</div>
<span class="text-warning size-14">
{{error|translate}}
</span>
</div>
<p translate class="text-gray">Permanently delete this wallet. WARNING: this action cannot be reversed.</p>
<div ng-show="!confirmDelete">
<a translate class="button warning m0" ng-click="confirmDelete=!confirmDelete">Delete wallet
</a>
</div>
<div class="text-center" ng-show="confirmDelete">
<h2>Are you sure you want to delete this wallet?</h2>
<div class="row">
<div class="large-6 medium-6 small-6 columns">
<button class="gray" ng-disabled="loading"
ng-click="confirmDelete=!confirmDelete">Cancel</button>
</div>
<div class="large-6 medium-6 small-6 columns">
<button class="warning" ng-disabled="loading" ng-click="deleteWallet()">
<span ng-show="!loading">
<i class="fi-trash"></i> Delete
</span>
<span ng-show="loading">
<i class="fi-bitcoin-circle icon-rotate spinner"></i> Deleting...
</span>
</button>
</div>
</div>
</div>
</div>
</div>
<div class="large-12 columns">
<div class="panel">
<h2><i class="fi-minus-circle m10r"></i>

View File

@ -35,75 +35,20 @@
<div class="line-dashed-h m20b"></div>
<div class="row" ng-init="setWallets()">
<div class="row size-12 m20b">
<div class="large-12 columns">
<h2>Manage wallets</h2>
<div class="box-notification" ng-show="success">
<div class="box-icon success">
<i class="fi-check size-24"></i>
</div>
<span class="text-success size-14">
{{success|translate}}
</span>
<a href ng-click="success=false" class="close-notification success">&#215;</a>
<div ng-if="perItem">
Your current server usage quotas are: <b>{{perItem}}kB</b> per wallet and up to <b>{{nrWallets}}</b> wallets.
</div>
<table class="manage-wallets">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="hide-for-small-only">Status</th>
<th class="hide-for-small-only">Balance</th>
<th class="hide-for-small-only">Approx Size</th>
</tr>
</thead>
<tbody>
<tr
data-ng-repeat="item in wallets | orderBy:'name'"
ng-init="isComplete = item.isComplete(); networkName = item.getNetworkName()"
ng-click="showWalletInfo(item)">
<td>
<span ng-show="loading == item.id"><i class="fi-bitcoin-circle icon-rotate spinner"></i></span>
<span ng-show="loading != item.id">
{{item.name || item.id }}
</span>
</td>
<td>{{item.requiredCopayers}} of {{item.totalCopayers}} - {{networkName}}</td>
<td class="hide-for-small-only">
{{isComplete ? 'Complete' : 'Waiting for copayers...'}}
</td>
<td class="hide-for-small-only">
<span ng-if="!isComplete">-</span>
<span ng-if="isComplete">
{{item.balanceInfo.totalBalance || 0}} {{item.settings.unitName}}
</span>
</td>
<td class="hide-for-small-only">
<span>
{{item.kb}} kB
<span ng-if="item.usage">({{item.usage}}%) </span>
</span>
</td>
</tr>
</tbody>
</table>
<div class="size-12">
<div ng-if="perItem">
Your current server usage quotas are: <b>{{perItem}}kB</b> per wallet and up to <b>{{nrWallets}}</b> wallets.
</div>
<div ng-if="$root.needsEmailConfirmation" class="m10t">
<i class="fi-alert"></i> Confirm your email address to increase storage usage limits.
</div>
<div ng-if="$root.needsEmailConfirmation" class="m10t">
<i class="fi-alert"></i> Confirm your email address to increase storage usage limits.
</div>
</div>
</div>
<div class="line-dashed-h m20b"></div>
<div class="row oh">
<div class="row oh m20b">
<div class="large-12 columns">
<a class="small left button-setup" ng-click="hideAdv=!hideAdv">
<i class="fi-widget m3r"></i>
@ -131,10 +76,18 @@
<h2>Are you sure you want to delete this profile?</h2>
<div class="row">
<div class="large-6 medium-6 small-6 columns">
<a translate class="button gray m0" ng-click="confirmDelete=!confirmDelete">Cancel</a>
<button class="gray" ng-disabled="loading"
ng-click="confirmDelete=!confirmDelete">Cancel</button>
</div>
<div class="large-6 medium-6 small-6 columns">
<a translate class="button warning m0" ng-click="deleteProfile()">Delete</a>
<button class="warning" ng-disabled="loading" ng-click="deleteProfile()">
<span ng-show="!loading">
<i class="fi-trash"></i> Delete
</span>
<span ng-show="loading">
<i class="fi-bitcoin-circle icon-rotate spinner"></i> Deleting...
</span>
</button>
</div>
</div>
</div>