Simple addressbook

This commit is contained in:
Gustavo Maximiliano Cortez 2015-10-22 18:43:32 -03:00
commit 6dd8b98dfc
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
12 changed files with 352 additions and 66 deletions

View file

@ -22,7 +22,7 @@
<span ng-show="!tx.merchant.pr.ca"><i class="fi-unlock"></i> {{tx.merchant.domain}}</span>
</span>
<span ng-if="!tx.merchant">
{{tx.toAddress}}
<contact address="{{tx.toAddress}}"></contact>
</span>
</span>
</div>

View file

@ -0,0 +1,130 @@
<div ng-init="wallets[0] ? selectedWalletsOpt = true : selectedWalletsOpts = false">
<nav class="tab-bar">
<section class="left-small">
<a ng-show="!editAddressbook" ng-click="cancel()" class="p10">
<span class="text-close" translate>Close</span>
</a>
</section>
<section class="middle tab-bar-section">
<ul class="button-group round even-2" ng-show="!editAddressbook && wallets[0]">
<li ng-class="{'selected':selectedWalletsOpt}" ng-click="selectedWalletsOpt = true"
translate>
Wallets
</li>
<li ng-class="{'selected':!selectedWalletsOpt}" ng-click="selectedWalletsOpt = false" translate>
Addressbook
</li>
</ul>
<h1 ng-show="editAddressbook || !wallets[0]" class="title ellipsis" ng-style="{'color':color}" translate>
Addressbook
</h1>
</section>
<section class="right-small" ng-show="!selectedWalletsOpt" ng-click="toggleEditAddressbook()">
<a ng-show="!editAddressbook" href class="p10">
<span class="text-close" translate>Edit</span>
</a>
<a ng-show="editAddressbook && !addAddressbookEntry" href class="p10">
<span class="text-close" translate>Done</span>
</a>
</section>
</nav>
<div class="modal-content fix-modals-touch">
<div ng-show="selectedWalletsOpt">
<div class="onGoingProcess" ng-if="gettingAddress">
<div class="onGoingProcess-content" ng-style="{'background-color':'#222'}">
<div class="spinner">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
<span translate> Getting address for wallet {{selectedWalletName}} ...</span>
</div>
</div>
<div ng-if="!gettingAddress">
<ul class="no-bullet">
<li class="line-b" ng-repeat="w in wallets">
<a ng-click="selectWallet(w.id, w.name)" class="db oh">
<div class="avatar-wallet"
ng-style="{'background-color':w.color}">{{(w.name || w.id) | limitTo: 1}}</div>
<div class="ellipsis name-wallet text-bold">{{w.name || w.id}}</div>
<div class="size-12">{{w.m}} of {{w.n}}
<span ng-show="w.network=='testnet'">[Testnet]</span>
</div>
</a>
</li>
</ul>
</div>
</div>
<div ng-show="!selectedWalletsOpt" class="m20b">
<ul ng-show="!addAddressbookEntry" class="no-bullet m0" ng-init="list()">
<li class="p10 line-b" ng-repeat="(addr, label) in list">
<a ng-show="selectedAddressbook[addr]"
class="removeAddressbook"
ng-click="remove(addr)" translate>Remove</a>
<a class="selectAddressbook"
ng-show="editAddressbook"
ng-click="toggleSelectAddressbook(addr)">
<i class="fi-trash"></i></a>
<div ng-click="selectAddressbook(addr)">
{{label}}
<div class="size-10 text-gray ellipsis">{{addr}}</div>
</div>
</li>
<li class="m10t" ng-show="!editAddressbook">
<a ng-click="toggleAddAddressbookEntry()" class="p10">
<i class="fi-plus size-18 m10r"></i>
<span class="text-close size-12" translate>Add a new entry</span>
</a>
</li>
</ul>
<div ng-if="addAddressbookEntry" ng-init="addressbook.address = ''; addressbook.label = ''">
<h4 class="title m0" translate>Add a new entry</h4>
<form name="addressbookForm" class="p10" no-validate>
<div class="text-warning size-12 m10b" ng-show="error">{{error|translate}}</div>
<span ng-hide="addressbookForm.address.$pristine">
<span class="has-error right size-12" ng-show="addressbookForm.address.$invalid && addressbook.address">
<i class="icon-close-circle size-14"></i>
<span class="vm" translate>Not valid</span>
</span>
<small class="right text-primary" ng-show="!addressbookForm.address.$invalid">
<i class="icon-checkmark-circle size-14"></i>
</small>
</span>
<label translate>Address</label>
<input type="text" id="address" name="address" ng-model="addressbook.address" valid-address required>
<label translate>Label</label>
<input type="text" id="label" name="label" ng-model="addressbook.label" required>
<div class="row">
<div class="columns large-6 medium-6 small-6">
<input type="button"
class="button expand round"
ng-click="toggleAddAddressbookEntry()"
value="{{'Cancel'|translate}}">
</div>
<div class="columns large-6 medium-6 small-6">
<input type="submit"
class="button expand round"
value="{{'Save'|translate}}"
ng-disabled="!addressbookForm.$valid"
ng-style="{'background-color':color}"
ng-click="add(addressbook)">
</div>
</div>
</form>
</div>
</div>
<div class="extra-margin-bottom"></div>
</div>
</div>

View file

@ -34,7 +34,8 @@
<span ng-show="!btx.merchant.pr.ca"><i class="fi-unlock color-yellowi"></i> {{btx.merchant.domain}}</span>
</span>
<span ng-if="!btx.merchant">
<span class="enable_text_select"> {{btx.labelTo || btx.addressTo}}</span>
<span ng-show="btx.labelTo">{{btx.labelTo}}</span>
<contact ng-show="!btx.labelTo" class="enable_text_select" address="{{btx.addressTo}}"></contact>
</span>
</span>
</li>

View file

@ -18,7 +18,7 @@
class="line-b p10 oh"
ng-click="copyAddress(tx.toAddress)">
<span class="text-gray" translate>To</span>:
<span class="right enable_text_select">{{tx.toAddress}}</span>
<contact class="right enable_text_select" address="{{tx.toAddress}}"></contact>
</li>
<li class="line-b p10">
<span ng-show="tx.hasMultiplesOutputs" class="text-gray" translate>Total</span>

View file

@ -1,44 +0,0 @@
<nav class="tab-bar">
<section class="left-small">
<a ng-click="cancel()" class="p10">
<span class="text-close" translate>Close</span>
</a>
</section>
<section class="middle tab-bar-section">
<h1 class="title ellipsis" ng-style="{'color':color}" translate>
Choose a wallet to send funds
</h1>
</section>
</nav>
<div class="modal-content">
<div class="onGoingProcess" ng-if="gettingAddress">
<div class="onGoingProcess-content" ng-style="{'background-color':'#222'}">
<div class="spinner">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
<span translate> Getting address for wallet {{selectedWalletName}} ...</span>
</div>
</div>
<div ng-if="!gettingAddress">
<ul class="no-bullet">
<li class="line-b" ng-repeat="w in wallets">
<a ng-click="selectWallet(w.id, w.name)" class="db oh">
<div class="avatar-wallet"
ng-style="{'background-color':w.color}">{{(w.name || w.id) | limitTo: 1}}</div>
<div class="ellipsis name-wallet text-bold">{{w.name || w.id}}</div>
<div class="size-12">{{w.m}} of {{w.n}}
<span ng-show="w.network=='testnet'">[Testnet]</span>
</div>
</a>
</li>
</ul>
</div>
<div class="extra-margin-bottom"></div>
</div>

View file

@ -320,8 +320,9 @@
</div>
<div class="input">
<input type="text" id="address" name="address" ng-disabled="home.blockUx || home.lockAddress" ng-attr-placeholder="{{'Bitcoin address'|translate}}" ng-model="_address" valid-address required ng-focus="home.formFocus('address')" ng-blur="home.formFocus(false)">
<a class="postfix size-12 m0 text-gray" ng-click="openWalletsModal(index.otherWallets)" ng-if="index.otherWallets && index.otherWallets.length>0">
<input ng-show="sendForm.address.$invalid" class="m0" type="text" id="address" name="address" ng-disabled="home.blockUx || home.lockAddress" ng-attr-placeholder="{{'Bitcoin address'|translate}}" ng-model="_address" valid-address required ng-focus="home.formFocus('address')" ng-blur="home.formFocus(false)">
<contact class="addressbook-input" ng-if="!sendForm.address.$invalid && _address" address="{{_address}}"></contact>
<a class="postfix size-12 m0 text-gray" ng-click="openDestinationAddressModal(index.otherWallets)">
<i class="icon-wallet size-18"></i>
</a>
</div>
@ -490,7 +491,8 @@
<i class="icon-arrow-right3 size-18"></i>
</div>
<div class="size-14 text-gray columns m5t" ng-if="btx.message || btx.addressTo">
{{btx.message || btx.addressTo}}
<div ng-show="btx.message">{{btx.message}}</div>
<contact ng-show="!btx.message" class="enable_text_select" address="{{btx.addressTo}}"></contact>
</div>
</div>
<div class="row m20t text-center" ng-show="index.txHistoryPaging || index.updatingTxHistory">