complete scope data for create wallets

This commit is contained in:
Javier 2016-09-05 17:14:41 -03:00
commit 6ba7b7c655
5 changed files with 110 additions and 187 deletions

View file

@ -1,14 +1,13 @@
<form name="setupForm" ng-submit="create.create(setupForm)" novalidate>
<form name="setupForm" ng-submit="create(setupForm)" novalidate>
<div class="card list">
<label class="item item-input item-stacked-label">
<span class="input-label" translate>Wallet name</span>
<input type="text"
placeholder="{{'Family vacation funds'|translate}}"
ng-model="walletName"
ng-model="formData.walletName"
ng-required="true"
ng-focus="create.formFocus('wallet-name')"
ng-blur="create.formFocus(false)">
ng-focus="formFocus('wallet-name')"
ng-blur="formFocus(false)">
</label>
<ion-toggle ng-model="showAdv" toggle-class="toggle-stable" ng-change="showAdvChange()">
@ -19,74 +18,63 @@
<div ng-show="showAdv">
<label class="item item-input item-stacked-label">
<span class="input-label">Wallet Service URL</span>
<input type="text" ng-model="bwsurl" placeholder="https://bws.bitpay.com/bws/api">
<input type="text" ng-model="formData.bwsurl" placeholder="https://bws.bitpay.com/bws/api">
</label>
<label class="item item-input item-select">
<div class="input-label" translate>
Wallet Key
</div>
<select class="m10t"
ng-model="seedSource"
ng-options="seed as seed.label for seed in create.seedOptions"
ng-change="create.setSeedSource()">
</select>
<select class="m10t" ng-model="seedSource" ng-options="seed as seed.label for seed in seedOptions"></select>
</label>
<label class="item item-input item-stacked-label" ng-show="create.seedSourceId == 'trezor' || create.seedSourceId == 'ledger'">
<label class="item item-input item-stacked-label" ng-show="seedSource.id == 'trezor' || seedSource.id == 'ledger'">
<span class="input-label" translate>Account Number</span>
<input type="number" id="account" ng-model="account" ignore-mouse-wheel>
<input type="number" ng-model="formData.account" ignore-mouse-wheel>
</label>
<div class="card" ng-show="create.seedSourceId=='new' && createPassphrase">
<div class="card" ng-show="seedSource.id == 'new' && createPassphrase">
<div class="item item-text-wrap" translate>
WARNING: The password cannot be recovered. <b>Be sure to write it down</b>. The wallet can not be restored without the password.
</div>
</div>
<label class="item item-input item-stacked-label" ng-show="create.seedSourceId=='new'">
<label class="item item-input item-stacked-label" ng-show="seedSource.id == 'new'">
<span class="input-label" translate>Add a Password</span>
<input type="text"
placeholder="{{'Add an optional password to secure the recovery phrase'|translate}}"
autocapitalize="off"
name="createPassphrase"
ng-model="createPassphrase">
ng-model="formData.createPassphrase">
</label>
<label class="item item-input item-stacked-label" ng-show="create.seedSourceId=='set'">
<label class="item item-input item-stacked-label" ng-show="seedSource.id == 'set'">
<span class="input-label" translate>Wallet Recovery Phrase</span>
<input id="ext-master"
placeholder="{{'Enter the recovery phrase (BIP39)'|translate}}"
<input placeholder="{{'Enter the recovery phrase (BIP39)'|translate}}"
autocapitalize="off"
type="text"
name="privateKey"
ng-model="privateKey">
ng-model="formData.privateKey">
</label>
<label class="item item-input item-stacked-label" ng-show="create.seedSourceId=='set'">
<label class="item item-input item-stacked-label" ng-show="seedSource.id == 'set'">
<span class="input-label" translate>Password</span>
<input type="text"
placeholder="{{'The recovery phrase could require a password to be imported'|translate}}"
autocapitalize="off"
name="passphrase"
ng-model="passphrase">
ng-model="formData.passphrase">
</label>
<label class="item item-input item-stacked-label" ng-show="create.seedSourceId == 'set'">
<label class="item item-input item-stacked-label" ng-show="seedSource.id == 'set'">
<span class="input-label" translate>Derivation Path</span>
<input type="text"
placeholder="{{'BIP32 path for address derivation'|translate}}"
name="derivationPath"
ng-model="derivationPath">
ng-model="formData.derivationPath">
</label>
<!-- <ion-toggle ng-show="create.seedSourceId == 'new'" ng-model="testnetEnabled" toggle-class="toggle-positive"> -->
<ion-toggle ng-model="testnetEnabled" toggle-class="toggle-positive">
Testnet
<ion-toggle ng-show="seedSource.id == 'new'" ng-model="formData.testnetEnabled" toggle-class="toggle-positive">
<span translate>Testnet</span>
</ion-toggle>
<ion-toggle ng-model="singleAddressEnabled" toggle-class="toggle-positive">
<ion-toggle ng-model="formData.singleAddressEnabled" toggle-class="toggle-positive">
<span translate>Single Address Wallet</span>
<small translate>For audit purposes</small>
</ion-toggle>
@ -94,16 +82,7 @@
</div> <!-- advanced -->
</div> <!-- list -->
<button type="submit"
class="button button-block button-positive"
ng-show="totalCopayers != 1" ng-disabled="setupForm.$invalid">
<span translate>Create {{requiredCopayers}}-of-{{totalCopayers}} wallet</span>
</button>
<button type="submit"
class="button button-block button-positive"
ng-show="totalCopayers == 1" ng-disabled="setupForm.$invalid">
<button type="submit" class="button button-block button-positive" ng-disabled="setupForm.$invalid">
<span translate>Create new wallet</span>
</button>
</form>