Merge pull request #1554 from cmgustavo/bug/05-import

Bug/import-backup
This commit is contained in:
Ivan Socolsky 2014-10-10 17:39:15 -03:00
commit 99ab79e1bf
11 changed files with 78 additions and 58 deletions

View File

@ -167,6 +167,7 @@ a:hover {
.join input,
.setup input,
.import input,
.import textarea,
.settings input {
background: #2C3E50 !important;
-moz-box-shadow: inset 0px 0px 3px 0px rgba(0,0,0,0.10) !important;
@ -269,7 +270,6 @@ a:hover {
.box-setup {
padding: 20px 30px;
background: #34495E;
margin-bottom: 20px;
}
.box-setup label small.has-error {
@ -420,7 +420,8 @@ table.last-transactions-content {
.m5b {margin-bottom: 5px;}
.m5r {margin-right: 5px;}
.m10b {margin-bottom: 10px;}
.m15b {margin-bottom: 20px;}
.m15b {margin-bottom: 15px;}
.m20b {margin-bottom: 20px;}
.m10r {margin-right: 10px;}
.m15l {margin-left: 15px;}
.m15t {margin-top: 15px;}
@ -487,7 +488,7 @@ table.last-transactions-content {
}
.line-dashed {
border-top: 1px dashed #ccc;
border-top: 1px dashed #3C5269;
margin: 1rem 0;
padding: 1rem 0;
overflow: hidden;
@ -926,10 +927,6 @@ button.gray:focus,
color: #2C3E50;
}
button, .button, p {
margin: 0;
}
.side-nav {padding: 0;}
.side-nav li {

View File

@ -171,5 +171,21 @@
margin-bottom: 0;
}
.button, button {
padding: 1rem 1.2rem 1.0625rem;
}
form {
margin: 0;
}
.box-setup {
margin-bottom: 50px;
}
.footer-setup {
margin-bottom: 50px;
}
}

View File

@ -1,12 +1,13 @@
'use strict';
angular.module('copayApp.controllers').controller('ImportController',
function($scope, $rootScope, $location, walletFactory, controllerUtils, Passphrase, notification) {
function($scope, $rootScope, $location, walletFactory, controllerUtils, Passphrase, notification, isMobile) {
controllerUtils.redirIfLogged();
$scope.title = 'Import a backup';
$scope.importStatus = 'Importing wallet - Reading backup...';
$scope.hideAdv = true;
$scope.is_iOS = isMobile.iOS();
var reader = new FileReader();
@ -69,10 +70,6 @@ angular.module('copayApp.controllers').controller('ImportController',
$scope.choosefile = !$scope.choosefile;
};
$scope.openPasteArea = function() {
$scope.pastetext = !$scope.pastetext;
};
$scope.getFile = function() {
// If we use onloadend, we need to check the readyState.
reader.onloadend = function(evt) {
@ -93,9 +90,10 @@ angular.module('copayApp.controllers').controller('ImportController',
}
var backupFile = $scope.file;
var backupText = form.backupText.$modelValue;
var password = form.password.$modelValue;
if (!backupFile) {
if (!backupFile && !backupText) {
$scope.loading = false;
notification.error('Error', 'Please, select your backup file');
$scope.loading = false;
@ -105,5 +103,8 @@ angular.module('copayApp.controllers').controller('ImportController',
if (backupFile) {
reader.readAsBinaryString(backupFile);
}
else {
_importBackup(backupText);
}
};
});

View File

@ -25,9 +25,9 @@
<span ng-if="$root.updatingBalance">
<i class="fi-bitcoin-circle icon-rotate spinner"></i>
</span>
<p class="size-14" ng-if="!$root.updatingBalance">
<span class="size-14" ng-if="!$root.updatingBalance">
<b>{{addr.balance || 0|noFractionNumber}} {{$root.wallet.settings.unitName}}</b>
</p>
</span>
</div>
<div class="large-1 columns show-for-large-up" ng-click="openAddressModal(addr)">
<a class="size-12" href=""> Show QR</a>
@ -40,12 +40,12 @@
<small translate class="m0 label" ng-if="addr.isChange">change</small>
</div>
<div class="text-left">
<p class="small-12 columns m15t" ng-if="$root.updatingBalance">
<span class="small-12 columns m15t" ng-if="$root.updatingBalance">
<i class="fi-bitcoin-circle icon-rotate spinner"></i>
</p>
<p class="size-14" ng-if="!$root.updatingBalance">
</span>
<span class="size-14" ng-if="!$root.updatingBalance">
<b>{{addr.balance || 0|noFractionNumber}} {{$root.wallet.settings.unitName}}</b>
</p>
</span>
</div>
</a> <!-- end of panel mobile -->
</div>

View File

@ -12,8 +12,10 @@
</div>
<div class="large-8 columns">
<div class="box-setup oh">
<img src="img/step-1.png" alt="Step 1" width="157" class="right m15t" ng-if="!isSetupWalletPage && !isMobile">
<img src="img/step-2.png" alt="Step 2" width="157" class="right m15t" ng-if="isSetupWalletPage && !isMobile">
<img src="img/step-1.png" alt="Step 1" width="157" class="right
m15t hide-for-small-only" ng-if="!isSetupWalletPage && !isMobile">
<img src="img/step-2.png" alt="Step 2" width="157" class="right
m15t hide-for-small-only" ng-if="isSetupWalletPage && !isMobile">
<h1 translate class="text-secondary line-sidebar-b">Create new wallet</h1>
<label ng-show="!isSetupWalletPage"><span translate>Wallet name</span>
<input type="text" placeholder="{{'Family vacation funds'|translate}}" class="form-control" ng-model="walletName">
@ -45,7 +47,7 @@
</div>
<a class="expand small" ng-click="hideAdv=!hideAdv">
<i class="fi-widget m3r"></i>
<i class="fi-widget m3r"></i>
<span translate ng-hide="!hideAdv">Show</span>
<span translate ng-hide="hideAdv">Hide</span>
<span translate>advanced options</span>
@ -54,7 +56,6 @@
<input id="network-name" type="checkbox" ng-model="networkName" ng-true-value="testnet" ng-false-value="livenet" class="form-control" ng-checked="networkName == 'testnet' ? true : false">
<label for="network-name" translate>Use test network</label>
<p>
<input type="text" placeholder="BIP32 master extended private key (hex)" name="private" ng-model="private">
</div>
@ -79,7 +80,7 @@
</div>
</div>
<p translate class="comment" ng-show="totalCopayers>1 && !isSetupWalletPage">(*) The limits are imposed by the bitcoin network.</p>
<div class="text-right">
<div class="text-right m20t">
<a ng-show="!isSetupWalletPage" class="back-button m20r" href="#!/">&laquo; <span translate>Back</span></a>
<a ng-show="isSetupWalletPage" class="back-button m20r" ng-click="setupWallet()">&laquo; <span translate>Back</span></a>
<button translate ng-show="isSetupWalletPage" type="submit" class="button secondary m0" ng-disabled="setupForm.$invalid || loading">

View File

@ -14,24 +14,36 @@
<div class="box-setup">
<h1 class="text-white line-sidebar-b">{{title|translate}}</h1>
<form name="importForm" ng-submit="import(importForm)" novalidate>
<fieldset>
<legend for="backupFile" class="m10b"> <span translate>Choose backup file from your computer</span> <i class="fi-laptop"></i></legend>
<input type="file" class="form-control"
placeholder="{{'Select a backup file'|translate}}" name="backupFile" ng-model="backupFile" ng-file-select>
<div ng-show="!is_iOS">
<legend for="backupFile" class="m10b">
<span translate>Choose backup file from your computer</span> <i class="fi-laptop"></i>
</legend>
<input type="file" class="form-control"
placeholder="{{'Select a backup file'|translate}}" name="backupFile" ng-model="backupFile" ng-file-select>
</div>
<div ng-show="is_iOS">
<label for="backupText" class="m10b">
<span translate>Paste backup plain text code</span> <i class="fi-clipboard"></i>
</label>
<textarea class="form-control"
name="backupText"
ng-model="backupText"
rows="5"></textarea>
</div>
<label for="password"><span translate>Password</span> <small translate>Required</small></label>
<label for="password" class="m10b"><span translate>Password</span> <small translate>Required</small></label>
<input type="password" class="form-control"
placeholder="{{'Your wallet password'|translate}}" name="password" ng-model="password" required>
<a class="expand small" ng-click="hideAdv=!hideAdv">
<i class="fi-widget m3r"></i>
<i class="fi-widget m3r"></i>
<span translate ng-hide="!hideAdv">Show</span>
<span translate ng-hide="hideAdv">Hide</span>
<span translate>advanced options</span>
</a>
<div ng-hide="hideAdv" class="m10t">
<label>
<input type="checkbox" class="form-control"
@ -47,14 +59,13 @@
</div>
</fieldset>
<div data-alert ng-show="skipFields">
<i class="size-18 fi-alert"></i>
<span translate>Skipping fields: {{skipFields}}</span>
</div>
<div class="text-right">
<div class="text-right m20t">
<a class="back-button text-white m20r" href="#!/">&laquo; <span translate>Back</span></a>
<button translate type="submit" class="button primary m0" ng-disabled="importForm.$invalid">
Import backup

View File

@ -34,7 +34,7 @@
</div>
<div class="large-3 medium-4 columns text-right hide-for-small-only">
<p class="size-12">{{tx.createdTs | amCalendar}}</p>
<span class="size-12">{{tx.createdTs | amCalendar}}</span>
</div>
</div>
</div>
@ -88,11 +88,9 @@
</a>
</div>
<div class="text-center">
<p class="size-12 text-gray ellipsis">
<div class="text-center m5t size-12 text-gray ellipsis">
{{c.cId === $root.wallet.getMyCopayerId() ? 'Me' : $root.wallet.publicKeyRing.nicknameForCopayer(c.cId)}}
</p>
</div>
</div>
</div>
</div>

View File

@ -13,7 +13,7 @@
<h1 translate class="text-primary line-sidebar-b">Join a Wallet in Creation</h1>
<form name="joinForm" ng-submit="join(joinForm)" novalidate>
<label for="connectionId"><span translate>Wallet Secret</span>
<label for="connectionId" class="m10b"><span translate>Wallet Secret</span>
<small translate class="has-error" ng-show="joinForm.connectionId.$invalid
&& !joinForm.connectionId.$pristine">Wallet Secret is not valid!</small>
<small translate data-options="disable_for_touch:true"
@ -55,7 +55,7 @@
</div>
</div>
<label translate for="joinPassword">User information</label>
<label translate for="joinPassword" class="m10b">User information</label>
<input id="joinPassword" type="text" class="form-control"
placeholder="{{'Your name'|translate}}" name="nickname"
ng-model="nickname" required>
@ -68,7 +68,7 @@
numbers and symbols</span>" tooltip-trigger="focus"
tooltip-placement="top" required>
<div class="pr line-sidebar-b">
<div class="pr">
<input type="password"
placeholder="{{'Repeat password'|translate}}"
name="joinPasswordConfirm"
@ -96,14 +96,10 @@
>
</div>
<div class="text-right">
<div class="text-right m20t">
<a href="#!/" class="back-button text-primary m20r">&laquo; <span translate>Back</span></a>
<button translate type="submit" class="button primary m0" ng-disabled="joinForm.$invalid || loading">Join</button>
</div>
</form>
</div>
</div>

View File

@ -20,7 +20,7 @@
</select>
<input type="password" class="form-control"
placeholder="{{'Your password'|translate}}" name="openPassword" ng-model="openPassword" required>
<div class="text-right">
<div class="text-right m20t">
<a href="#!/" class="back-button text-white m20r">&laquo; <span translate>Back</span></a>
<button translate type="submit" class="button white m0" ng-disabled="openForm.$invalid || loading">Open</button>
</div>

View File

@ -24,7 +24,7 @@
Insight API server is open-source software. You can run your own instances, check <a href="http://insight.is" target="_blank">Insight API Homepage</a>
</p>
</fieldset>
<div class="text-right">
<div class="text-right m20t">
<a class="back-button text-white m20r" href="#!/">&laquo; <span translate>Back</span></a>
<button translate type="submit" class="button primary m0 ng-binding" ng-disabled="setupForm.$invalid || loading" disabled="disabled" ng-click="save()">
Save

View File

@ -53,8 +53,8 @@
</div>
<div class="last-transactions-content">
<div class="large-5 medium-5 small-12 columns">
<div ng-repeat="vin in btx.vinSimple">
<small class="right m5t"
<div ng-repeat="vin in btx.vinSimple" class="m5b">
<small class="right"
ng-class="{'has-tip': vin.valueAlt}"
data-options="disable_for_touch:true"
tooltip-popup-delay='500'
@ -64,9 +64,9 @@
>
{{vin.value| noFractionNumber}} {{$root.wallet.settings.unitName}}
</small>
<p class="ellipsis text-gray size-12">
<div class="ellipsis text-gray size-12">
<contact address="{{vin.addr}}" tooltip-popup-delay="500" tooltip tooltip-placement="right" />
</p>
</div>
</div>
</div>
<div class="large-1 medium-1 hide-for-small-only columns text-center">
@ -76,8 +76,8 @@
<i class="fi-arrow-down"></i>
</div>
<div class="large-6 medium-6 small-12 columns">
<div ng-repeat="vout in btx.voutSimple">
<small class="right m5t"
<div ng-repeat="vout in btx.voutSimple" class="m5b">
<small class="right"
ng-class="{'has-tip': vout.valueAlt}"
data-options="disable_for_touch:true"
tooltip-popup-delay='500'
@ -86,17 +86,17 @@
tooltip-placement="left"
>
{{vout.value| noFractionNumber}} {{$root.wallet.settings.unitName}}</small>
<p class="ellipsis text-gray size-12">
<div class="ellipsis text-gray size-12">
<contact address="{{vout.addr}}" tooltip-popup-delay="500" tooltip tooltip-placement="right" />
</p>
</div>
</div>
</div>
</div>
<div class="last-transactions-footer">
<div class="row collapse">
<div class="large-6 medium-6 small-6 columns">
<p class="size-12"><span translate>Fee</span>: {{btx.fees | noFractionNumber}} {{$root.wallet.settings.unitName}}</p>
<p class="size-12"><span translate>Confirmations</span>: {{btx.confirmations || 0}}</p>
<div class="size-12"><span translate>Fee</span>: {{btx.fees | noFractionNumber}} {{$root.wallet.settings.unitName}}</div>
<div class="size-12"><span translate>Confirmations</span>: {{btx.confirmations || 0}}</div>
</div>
<div class="large-6 medium-6 small-6 columns text-right">
<p class="label size-14"><span translate>Total</span>: {{btx.valueOut| noFractionNumber}} {{$root.wallet.settings.unitName}}</p>