add tabs to export, create wallet and import wallet

This commit is contained in:
Gabriel Bazán 2016-08-19 16:16:24 -03:00
commit 588550120a
14 changed files with 738 additions and 545 deletions

View file

@ -1,131 +1,13 @@
<ion-view cache-view="false">
<ion-tabs class="tabs-striped tabs-color-positive tabs-color-active-positive tabs-top">
<ion-view>
<ion-nav-bar class="bar-stable">
<ion-nav-title>Export Wallet</ion-nav-title>
<ion-nav-buttons side="primary">
<button class="button no-border" ui-sref="wallet.preferencesAdvanced">
<i class="icon ion-chevron-left"></i> Back
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content ng-controller="exportController" cache-view="false" ng-init="init()">
<ion-tab title="File/Text" ui-sref="wallet.export.file">
<ion-nav-view name="tab-export-file"></ion-nav-view>
</ion-tab>
<div ng-show="!canSign"><h4></h4></div>
<div class="row" ng-show="canSign">
<div class="col"
ng-class="{'selected':!exportQR}"
ng-style="{'border-color':!exportQR ? wallet.color: 'inherit'}"
ng-click="exportQR = false">
<a class="button button-full button-clear" ng-style="{'color':!exportQR ? wallet.color: 'inherit'}" translate>File/Text</a>
</div>
<div class="col"
ng-class="{'selected':exportQR}"
ng-style="{'border-color':exportQR ? wallet.color: 'inherit'}"
ng-click="exportQR = true">
<a class="button button-full button-clear" ng-style="{'color':exportQR ? wallet.color: 'inherit'}" translate>QR Code</a>
</div>
</div>
<ion-tab title="QR Code" ui-sref="wallet.export.qrCode">
<ion-nav-view name="tab-export-qrCode"></ion-nav-view>
</ion-tab>
<div ng-show="!backupWalletPlainText">
<div class="text-warning size-14 m20b" ng-show="error">
<i class="fi-alert size-12"></i>
<span translate>Failed to export</span>
</div>
<form name="exportForm" ng-show="!exportQR" novalidate>
<label class="item item-input item-stacked-label">
<span class="input-label" transalate>Set up a password</span>
<input type="password" placeholder="{{'Your password'|translate}}" name="password" ng-model="password">
</label>
<label class="item item-input item-stacked-label">
<span class="input-label" transalate>Repeat the password</span>
<input type="password" class="form-control" placeholder="{{'Repeat password'|translate}}" name="password" ng-model="repeatpassword">
</label>
</form>
<div class="m20t text-gray" ng-show="exportQR && supported">
<div class="text-center m20b">
<qrcode size="220" version="8" error-correction-level="M" data="{{exportWalletInfo}}"></qrcode>
</div>
<div class="text-center size-12 m10" translate>From the destination device, go to Add wallet &gt; Import wallet and scan this QR code</div>
</div>
<div class="m20t text-gray" ng-show="exportQR && !supported">
<div class="text-center size-12 m10" translate>Exporting via QR not supported for this wallet</div>
</div>
<ion-toggle ng-show="!exportQR && canSign" ng-model="showAdvanced" toggle-class="toggle-balanced">
<span translate ng-show="!showAdvanced">Show advanced options</span>
<span translate ng-show="showAdvanced">Hide advanced options</span>
</ion-toggle>
<ion-toggle ng-model="noSignEnabled" ng-show="showAdvanced && !exportQR" toggle-class="toggle-balanced" class="r0" ng-change="noSignEnabledChange()">
<span class="toggle-label" translate>Do not include private key</span>
</ion-toggle>
<div class="box-notification p15l" ng-show="!canSign">
<span class="text-warning size-14">
<i class="ion-alert-circled"></i>
<span translate>
WARNING: The private key of this wallet is not available. The export allows to check the wallet balance, transaction history, and create spend proposals from the export. However, does not allow to approve (sign) proposals, so <b>funds will not be accessible from the export</b>.
</span>
</span>
</div>
<div class="box-notification p15l" ng-show="noSignEnabled && !exportQR">
<span class="text-warning size-14">
<i class="ion-alert-circled"></i>
<span translate>
WARNING: Not including the private key allows to check the wallet balance, transaction history, and create spend proposals from the export. However, does not allow to approve (sign) proposals, so <b>funds will not be accessible from the export</b>.
</span>
</span>
</div>
<button ng-show="!exportQR"
ng-click="downloadWalletBackup()"
class="button button-block button-positive"
ng-disabled="(!password || password != repeatpassword)"
ng-style="{'background-color':wallet.color}"
ng-show="!isSafari && !isCordova">
<i class="fi-download"></i>
<span translate>Download</span>
</button>
<button ng-show="!exportQR"
ng-click="viewWalletBackup()"
class="button button-block button-positive"
ng-disabled="(!password || password != repeatpassword)"
ng-style="{'background-color':wallet.color}"
ng-show="isSafari && !isCordova">
<i class="fi-eye"></i>
<span translate>View</span>
</button>
<div ng-show="isCordova">
<h4 translate>Export options</h4>
<button class="button button-block button-positive"
ng-disabled="(!password || password != repeatpassword)"
ng-style="{'background-color':index.backgroundColor}"
ng-click="copyWalletBackup()">
<i class="fi-clipboard-pencil"></i>
<span translate>Copy to clipboard</span></button>
<button class="button button-block button-positive" ng-disabled="(!password || password != repeatpassword)"
ng-style="{'background-color':index.backgroundColor}"
ng-click="sendWalletBackup()"><i class="fi-mail"></i>
<span translate>Send by email</span></button>
</div>
</div>
<div class="row" ng-show="backupWalletPlainText">
<div class="large-12 columns">
<h3 translate>Wallet Export</h3>
<div class="input">
<textarea rows="12">{{backupWalletPlainText}}</textarea>
</div>
<div class="size-12 text-gray text-right">
<i class="icon-compose"></i>
<span translate>Copy this text as it is to a safe place (notepad or email)</span>
</div>
</div>
</div>
</ion-content>
</ion-tabs>
</ion-view>