renamed tab-send files

This commit is contained in:
Sebastiaan Pasma 2018-07-10 11:11:11 +02:00
commit af6ddce7fe
6 changed files with 327 additions and 866 deletions

View file

@ -1,311 +0,0 @@
'use strict';
angular.module('copayApp.controllers').controller('tabSendV2Controller', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService, $ionicNavBarDelegate, clipboardService) {
var clipboardHasAddress = false;
var clipboardHasContent = false;
$scope.addContact = function() {
$state.go('tabs.settings').then(function() {
$state.go('tabs.addressbook').then(function() {
$state.go('tabs.addressbook.add');
});
});
};
$scope.pasteClipboard = function() {
if ($scope.clipboardHasAddress || $scope.clipboardHasContent) {
clipboardService.readFromClipboard(function(text) {
$scope.formData.search = text;
$scope.findContact($scope.formData.search);
});
}
};
$scope.$on("$ionicView.enter", function(event, data) {
clipboardService.readFromClipboard(function(text) {
if (text.length > 200) {
text = text.substring(0, 200);
}
$scope.clipboardHasAddress = false;
$scope.clipboardHasContent = false;
if ((text.indexOf('bitcoincash:') === 0 || text[0] === 'C' || text[0] === 'H' || text[0] === 'p' || text[0] === 'q') && text.replace('bitcoincash:', '').length === 42) { // CashAddr
$scope.clipboardHasAddress = true;
} else if ((text[0] === "1" || text[0] === "3" || text.substring(0, 3) === "bc1") && text.length >= 26 && text.length <= 35) { // Legacy Addresses
$scope.clipboardHasAddress = true;
} else if (text.length > 1) {
$scope.clipboardHasContent = true;
}
});
$ionicNavBarDelegate.showBar(true);
if (!$scope.hasWallets) {
$scope.checkingBalance = false;
return;
}
updateHasFunds();
updateWalletsList();
updateContactsList(function() {
updateList();
});
});
var originalList;
var CONTACTS_SHOW_LIMIT;
var currentContactsPage;
$scope.sectionDisplay = {
transferToWallet: false
};
var hasWallets = function() {
$scope.wallets = profileService.getWallets({
onlyComplete: true
});
$scope.hasWallets = lodash.isEmpty($scope.wallets) ? false : true;
};
// THIS is ONLY to show the 'buy bitcoins' message
// does not has any other function.
var updateHasFunds = function() {
if ($rootScope.everHasFunds) {
$scope.hasFunds = true;
return;
}
$scope.hasFunds = false;
var index = 0;
lodash.each($scope.wallets, function(w) {
walletService.getStatus(w, {}, function(err, status) {
++index;
if (err && !status) {
$log.error(err);
// error updating the wallet. Probably a network error, do not show
// the 'buy bitcoins' message.
$scope.hasFunds = true;
} else if (status.availableBalanceSat > 0) {
$scope.hasFunds = true;
$rootScope.everHasFunds = true;
}
if (index == $scope.wallets.length) {
$scope.checkingBalance = false;
$timeout(function() {
$scope.$apply();
});
}
});
});
};
var updateWalletsList = function() {
var config = configService.getSync();
var networkResult = lodash.countBy($scope.wallets, 'network');
$scope.showTransferCard = $scope.hasWallets && (networkResult.livenet > 1 || networkResult.testnet > 1);
if ($scope.showTransferCard) {
var walletsToTransfer = $scope.wallets;
if (!(networkResult.livenet > 1)) {
walletsToTransfer = lodash.filter(walletsToTransfer, function(item) {
return item.network == 'testnet';
});
}
if (!(networkResult.testnet > 1)) {
walletsToTransfer = lodash.filter(walletsToTransfer, function(item) {
return item.network == 'livenet';
});
}
var walletList = [];
lodash.each(walletsToTransfer, function(v) {
var displayBalanceAsFiat =
// BD got v.status as undefined here once during development, just
// after creating a new wallet.
v.status &&
v.status.alternativeBalanceAvailable &&
config.wallet.settings.priceDisplay === 'fiat';
walletList.push({
color: v.color,
name: v.name,
recipientType: 'wallet',
coin: v.coin,
network: v.network,
balanceString: displayBalanceAsFiat ?
v.status.totalBalanceAlternative + ' ' + v.status.alternativeIsoCode :
v.cachedBalance,
getAddress: function(cb) {
walletService.getAddress(v, false, cb);
},
});
});
originalList = originalList.concat(walletList);
}
}
var updateContactsList = function(cb) {
var config = configService.getSync();
var defaults = configService.getDefaults();
addressbookService.list(function(err, ab) {
if (err) $log.error(err);
$scope.hasContacts = lodash.isEmpty(ab) ? false : true;
if (!$scope.hasContacts) return cb();
var completeContacts = [];
lodash.each(ab, function(v, k) {
completeContacts.push({
name: lodash.isObject(v) ? v.name : v,
address: k,
email: lodash.isObject(v) ? v.email : null,
recipientType: 'contact',
coin: v.coin,
displayCoin: (v.coin == 'bch'
? (config.bitcoinCashAlias || defaults.bitcoinCashAlias)
: (config.bitcoinAlias || defaults.bitcoinAlias)).toUpperCase(),
getAddress: function(cb) {
return cb(null, k);
},
});
});
var contacts = completeContacts.slice(0, (currentContactsPage + 1) * CONTACTS_SHOW_LIMIT);
$scope.contactsShowMore = completeContacts.length > contacts.length;
originalList = originalList.concat(contacts);
return cb();
});
};
var updateList = function() {
$scope.list = lodash.clone(originalList);
$timeout(function() {
$ionicScrollDelegate.resize();
$scope.$apply();
}, 10);
};
$scope.openScanner = function() {
var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
if (!isWindowsPhoneApp) {
$state.go('tabs.scan');
return;
}
scannerService.useOldScanner(function(err, contents) {
if (err) {
popupService.showAlert(gettextCatalog.getString('Error'), err);
return;
}
incomingData.redir(contents);
});
};
$scope.showMore = function() {
currentContactsPage++;
updateWalletsList();
};
$scope.searchInFocus = function() {
$scope.searchFocus = true;
};
$scope.searchBlurred = function() {
if ($scope.formData.search == null || $scope.formData.search.length == 0) {
$scope.searchFocus = false;
}
};
$scope.findContact = function(search) {
if (incomingData.redir(search)) {
return;
}
if (!search || search.length < 2) {
$scope.list = originalList;
$timeout(function() {
$scope.$apply();
});
return;
}
var result = lodash.filter(originalList, function(item) {
var val = item.name;
return lodash.includes(val.toLowerCase(), search.toLowerCase());
});
$scope.list = result;
};
$scope.goToAmount = function(item) {
$timeout(function() {
item.getAddress(function(err, addr) {
if (err || !addr) {
//Error is already formated
return popupService.showAlert(err);
}
if (item.recipientType && item.recipientType == 'contact') {
if (addr.indexOf('bch') == 0 || addr.indexOf('btc') == 0) {
addr = addr.substring(3);
}
}
$log.debug('Got toAddress:' + addr + ' | ' + item.name);
return $state.transitionTo('tabs.send.amount', {
recipientType: item.recipientType,
displayAddress: item.coin == 'bch' ? bitcoinCashJsService.translateAddresses(addr).cashaddr : addr,
toAddress: addr,
toName: item.name,
toEmail: item.email,
toColor: item.color,
coin: item.coin
});
});
});
};
// This could probably be enhanced refactoring the routes abstract states
$scope.createWallet = function() {
$state.go('tabs.home').then(function() {
$state.go('tabs.add.create-personal');
});
};
$scope.buyBitcoin = function() {
$state.go('tabs.home').then(function() {
$state.go('tabs.buyandsell');
});
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.checkingBalance = true;
$scope.formData = {
search: null
};
originalList = [];
CONTACTS_SHOW_LIMIT = 10;
currentContactsPage = 0;
hasWallets();
});
});

View file

@ -1,11 +1,74 @@
'use strict';
angular.module('copayApp.controllers').controller('tabSendController', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService, $ionicNavBarDelegate) {
angular.module('copayApp.controllers').controller('tabSendV2Controller', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService, $ionicNavBarDelegate, clipboardService) {
var clipboardHasAddress = false;
var clipboardHasContent = false;
$scope.addContact = function() {
$state.go('tabs.settings').then(function() {
$state.go('tabs.addressbook').then(function() {
$state.go('tabs.addressbook.add');
});
});
};
$scope.pasteClipboard = function() {
if ($scope.clipboardHasAddress || $scope.clipboardHasContent) {
clipboardService.readFromClipboard(function(text) {
$scope.formData.search = text;
$scope.findContact($scope.formData.search);
});
}
};
$scope.$on("$ionicView.enter", function(event, data) {
clipboardService.readFromClipboard(function(text) {
if (text.length > 200) {
text = text.substring(0, 200);
}
$scope.clipboardHasAddress = false;
$scope.clipboardHasContent = false;
if ((text.indexOf('bitcoincash:') === 0 || text[0] === 'C' || text[0] === 'H' || text[0] === 'p' || text[0] === 'q') && text.replace('bitcoincash:', '').length === 42) { // CashAddr
$scope.clipboardHasAddress = true;
} else if ((text[0] === "1" || text[0] === "3" || text.substring(0, 3) === "bc1") && text.length >= 26 && text.length <= 35) { // Legacy Addresses
$scope.clipboardHasAddress = true;
} else if (text.length > 1) {
$scope.clipboardHasContent = true;
}
});
$ionicNavBarDelegate.showBar(true);
if (!$scope.hasWallets) {
$scope.checkingBalance = false;
return;
}
updateHasFunds();
updateWalletsList();
updateContactsList(function() {
updateList();
});
});
var originalList;
var CONTACTS_SHOW_LIMIT;
var currentContactsPage;
$scope.isChromeApp = platformInfo.isChromeApp;
$scope.sectionDisplay = {
transferToWallet: false
};
@ -245,25 +308,4 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
currentContactsPage = 0;
hasWallets();
});
$scope.$on("$ionicView.enter", function(event, data) {
$ionicNavBarDelegate.showBar(true);
if (!$scope.hasWallets) {
$scope.checkingBalance = false;
return;
}
updateHasFunds();
updateWalletsList();
updateContactsList(function() {
updateList();
});
});
$scope.toggle = function(section) {
$scope.sectionDisplay[section] = !$scope.sectionDisplay[section];
$timeout(function() {
$ionicScrollDelegate.resize();
$scope.$apply();
}, 10);
};
});

View file

@ -1,236 +0,0 @@
#tab-send2 {
@extend .deflash-blue;
.input {
width: 100%;
input {
width: 100%;
height: 57px;
background: #FFF;
border: 1px #D9D9D9 solid;
&::placeholder {
color: #DCDCDC;
}
}
i {
&.left {
padding-left: 15px;
}
&.qr {
cursor: pointer;
cursor: hand;
padding-right: 5px;
}
}
}
.send-wrapper {
&:after {
display: block;
position: relative;
height: 1px;
background: #DEDEDE;
bottom: 0;
content: '';
margin: 20px 6px 0px;
}
margin: 18px 0 0;
padding: 9px;
background-color: #f2f2f2;
border-radius: 3px;
border: none;
&.focus {
.search-input {
padding-left: 30px;
&:focus::-webkit-input-placeholder {
opacity: 0;
}
}
}
.buttons {
margin: auto;
margin-top: 18px;
.button {
&-clipboard-paste {
margin-left: 0;
.address {
display: none;
}
.icon {
background: url(../img/icon-clipboard-paste.svg);
width: 15px;
height: 19px;
display: inline-block;
margin-bottom: 4px;
}
&.contains-address, &.contains-content {
.address {
display: none;
}
background: #FAB915;
color: #FFF !important;
border: 0;
@include button-shadow();
.icon {
background: url(../img/icon-clipboard-paste-white.svg);
}
&.contains-address {
.address {
display: inline;
}
.non-address {
display: none;
}
}
}
}
span {
font-size: 14px;
}
img {
height: 16px;
width: auto;
margin: 2px 0 4px;
}
height: 60px;
line-height: 16px;
margin-right: 0px;
width: 95%;
max-width: none;
padding: 2px;
&-qr {
font-weight: bold;
max-width: none;
width: 100%;
height: 95px;
margin-top: 20px;
img {
vertical-align: middle;
margin-right: 12px;
width: 43px;
height: 43px;
}
span {
font-size: 19px;
}
}
}
}
}
.search-input {
background-color: transparent;
padding-left: 30px;
}
.sendTip {
padding-top: 5vh;
text-align: center;
.item {
border-style: none;
}
& > .title {
font-size: 20px;
color: $v-dark-gray;
margin: 20px 10px;
}
& > .subtitle {
font-size: 1rem;
line-height: 1.5em;
font-weight: 300;
color: #6F6F70;
margin: 20px 1em 2.5em;
}
.big-icon-svg {
.bg.green {
padding: 0 10px;
box-shadow: none;
}
}
.buttons {
margin-top: 18px;
.button {
font-weight: bold;
font-size: 19px;
}
}
.button-first-contact img {
height: 19px;
width: 19px;
margin-right: 6px;
vertical-align: sub;
}
}
.item-heading {
line-height: 16px;
font-size: 14px;
font-weight: bold;
.subtitle {
color: #B5B2B2;
font-size: 12px;
font-weight: 300;
}
}
.list {
.item {
font-weight: 600;
padding-top: 12px;
padding-bottom: 12px;
p {
font-weight: normal;
}
&.item-icon-left {
padding-left: 64px;
}
color: #444;
//border-top: none;
padding-top: 1.5rem;
padding-bottom: 1.5rem;
.big-icon-svg {
left: 5px;
& > .bg {
width: 30px;
height: 30px;
box-shadow: none;
}
}
&:before {
display: block;
position: absolute;
width: 100%;
height: 1px;
background: rgba(221, 221, 221, 0.3);
top: 0;
right: 0;
content: '';
}
&.item-divider {
color: rgba(74, 74, 74, .8);
}
&.item-heading {
&:before {
top: 99%;
width: 100%;
}
}
&:nth-child(2) {
&:before {
width: 0;
}
}
.item-note {
color: rgb(58, 58, 58);
}
}
}
.scroll {
height: 100%;
}
.card.contacts {
margin: 4px;
border-radius: 6px;
box-shadow: 0px 2px 1px 0 #C1C1C1;
.gravatar {
border-radius: 30px;
}
}
}

View file

@ -1,12 +1,15 @@
#tab-send {
@extend .deflash-blue;
.input {
width: 100%;
input {
width: 100%;
height: auto;
}
&.item {
height: 55px;
height: 57px;
background: #FFF;
border: 1px #D9D9D9 solid;
&::placeholder {
color: #DCDCDC;
}
}
i {
&.left {
@ -19,45 +22,23 @@
}
}
}
.qr-scan-icon {
cursor: pointer;
cursor: hand;
border-left: 1px solid rgb(228, 228, 228);
padding-left: 10px;
}
.qr-icon {
line-height: 20px;
}
.zero-state-cta {
padding-bottom: 3vh;
left: 0;
}
.send-heading {
font-size: 14px;
font-weight: bold;
padding: 0 0 16px 0;
border: none;
}
.send-header-wrapper {
padding: 10px;
background-color: white;
box-shadow: 0px 5px 10px 0px #cccccc;
}
.search-wrapper {
.send-wrapper {
&:after {
display: block;
position: relative;
height: 1px;
background: #DEDEDE;
bottom: 0;
content: '';
margin: 20px 6px 0px;
}
margin: 18px 0 0;
padding: 9px;
background-color: #f2f2f2;
border-radius: 3px;
border: none;
.svg#Bitcoin_Symbol {
width: 14px;
.st0 {
fill: #cccccc;
}
}
&.focus {
background: none;
.svg#Bitcoin_Symbol {
display: none;
}
.search-input {
padding-left: 30px;
&:focus::-webkit-input-placeholder {
@ -65,57 +46,88 @@
}
}
}
.buttons {
margin: auto;
margin-top: 18px;
.button {
&-clipboard-paste {
margin-left: 0;
.address {
display: none;
}
.icon {
background: url(../img/icon-clipboard-paste.svg);
width: 15px;
height: 19px;
display: inline-block;
margin-bottom: 4px;
}
&.contains-address, &.contains-content {
.address {
display: none;
}
background: #FAB915;
color: #FFF !important;
border: 0;
@include button-shadow();
.icon {
background: url(../img/icon-clipboard-paste-white.svg);
}
&.contains-address {
.address {
display: inline;
}
.non-address {
display: none;
}
}
}
}
span {
font-size: 14px;
}
img {
height: 16px;
width: auto;
margin: 2px 0 4px;
}
height: 60px;
line-height: 16px;
margin-right: 0px;
width: 95%;
max-width: none;
padding: 2px;
&-qr {
font-weight: bold;
max-width: none;
width: 100%;
height: 95px;
margin-top: 20px;
img {
vertical-align: middle;
margin-right: 12px;
width: 43px;
height: 43px;
}
span {
font-size: 19px;
}
}
}
}
}
.abs-v-center {
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.search-input {
background-color: transparent;
padding-left: 30px;
}
.separator-left {
border-left: 1px solid #d9d9df;
padding-left: 10px;
height: 70%;
}
.bitcoin-address {
border-top: none;
padding-bottom: .5rem;
@media(max-width: 480px) {
input {
font-size: 14px;
}
}
.icon {
line-height: 31px;
padding-top: 2px;
padding-bottom: 1px;
}
}
.show-more {
text-align: center;
padding: 20px;
font-size: 16px;
color: #387ef5;
font-weight: bold;
}
.sendTip {
padding-top: 5vh;
text-align: center;
& > .item-heading {
margin-top: 10px;
background: 0 none;
}
img {
content: $v-tab-send-selected-icon;
}
.item {
border-style: none;
}
& > .title {
font-size: 20px;
font-weight: bold;
color: $v-dark-gray;
margin: 20px 10px;
}
@ -123,34 +135,66 @@
font-size: 1rem;
line-height: 1.5em;
font-weight: 300;
color: $v-dark-gray;
color: #6F6F70;
margin: 20px 1em 2.5em;
}
.big-icon-svg{
.bg.green{
.big-icon-svg {
.bg.green {
padding: 0 10px;
box-shadow: none;
}
}
.buttons {
margin-top: 18px;
.button {
font-weight: bold;
font-size: 19px;
}
}
.button-first-contact img {
height: 19px;
width: 19px;
margin-right: 6px;
vertical-align: sub;
}
}
.item-heading {
line-height: 16px;
font-size: 14px;
font-weight: bold;
.subtitle {
color: #B5B2B2;
font-size: 12px;
font-weight: 300;
}
}
.list {
.item {
font-weight: 600;
padding-top: 12px;
padding-bottom: 12px;
p {
font-weight: normal;
}
&.item-icon-left {
padding-left: 64px;
}
color: #444;
border-top: none;
//border-top: none;
padding-top: 1.5rem;
padding-bottom: 1.5rem;
.big-icon-svg {
left:5px;
& > .bg{
width:30px;
height:30px;
box-shadow: none;
}
left: 5px;
& > .bg {
width: 30px;
height: 30px;
box-shadow: none;
}
}
&:before {
display: block;
position: absolute;
width: 80%;
width: 100%;
height: 1px;
background: rgba(221, 221, 221, 0.3);
top: 0;
@ -163,7 +207,7 @@
&.item-heading {
&:before {
top: 99%;
width:100%;
width: 100%;
}
}
&:nth-child(2) {
@ -176,5 +220,17 @@
}
}
}
.scroll{height: 100%;}
.scroll {
height: 100%;
}
.card.contacts {
margin: 4px;
border-radius: 6px;
box-shadow: 0px 2px 1px 0 #C1C1C1;
.gravatar {
border-radius: 30px;
}
}
}

View file

@ -1,143 +0,0 @@
<ion-view id="tab-send2" show-tabs>
<ion-nav-bar class="bar-royal">
<ion-nav-title>{{'Send' | translate}}</ion-nav-title>
</ion-nav-bar>
<ion-content>
<div ng-if="hasFunds">
<div class="send-wrapper item">
<div class="row">
<div class="input" ng-class="{'focus': searchFocus}">
<input type="text" class="search-input" placeholder="{{'Search or enter bitcoin address' | translate}}"
ng-model="formData.search" ng-change="findContact(formData.search)" ng-model-onblur
ng-focus="searchInFocus()" ng-blur="searchBlurred()">
</div>
</div>
<div class="buttons">
<div class="row">
<div class="col-40">
<button class="button button-standard button-primary button-outline button-clipboard-paste" ng-click="pasteClipboard()" ng-class="{'contains-address': clipboardHasAddress, 'contains-content': clipboardHasContent}">
<span class="icon"></span><br/>
<span class="non-address" translate>Paste Clipboard</span>
<span class="address" translate>Paste Address</span>
</button>
</div>
<div class="col-60">
<button class="button button-standard button-primary button-outline">
<img src="img/icon-w2w.svg"/><br/>
<span translate>Wallet to Wallet Transfer</span>
</button>
</div>
</div>
<div class="row">
<button class="button button-standard button-green button-qr" ui-sref="tabs.scan">
<span>
<img src="img/icon-scan-qr.svg"/>
<span translate>Scan QR Code</span>
</span>
</button>
</div>
</div>
</div>
</div>
<div ng-if="hasWallets && hasFunds && !hasContacts">
<div class="list sendTip">
<div class="title" translate>
Send Bitcoin faster!
</div>
<div class="subtitle">
<div ng-show="hasWallets" translate>
<p>Save frequently used addresses and send them Bitcoin in just one tap</p>
</div>
<div class="padding buttons">
<a class="button-first-contact" ng-click="addContact()">
<img src="img/icon-contact-add.svg"/>
<span translate>Add your first contact</span>
</a>
</div>
</div>
</div>
</div>
<div ng-if="!checkingBalance && (!hasFunds || !hasWallets)">
<div class="list card sendTip">
<div class="title" translate>
Your Bitcoin wallet is empty
</div>
<div class="subtitle">
<div ng-show="hasWallets" translate>
<p>To get started, buy Bitcoin Cash (BCH) or Bitcoin Core (BTC), or share your address.</p>
<p>You can receive bitcoin from any wallet or service.</p>
</div>
<div ng-show="!hasWallets" translate>To get started, you'll need to create a bitcoin wallet and get some
bitcoin.
</div>
<div class="padding buttons">
<button class="button button-standard button-green" ng-click="buyBitcoin()" ng-show="hasWallets" translate>
Buy Bitcoin now
</button>
<button class="button button-standard button-green" ng-click="createWallet()" ng-show="!hasWallets"
translate>Create bitcoin wallet
</button>
<button class="button button-standard button-white" ui-sref="tabs.receive" ng-show="hasWallets" translate>
Show my address
</button>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="card contacts" ng-if="hasContacts && hasWallets && hasFunds">
<div class="item item-icon-right item-heading">
<div translate>Contacts</div>
<div translate class="subtitle"><span style="">Saved frequently used addresses</span></div>
<a ng-if="hasContacts" ui-sref="tabs.send.addressbook">
<i class="icon ion-ios-plus-empty list-add-button"></i>
</a>
</div>
<div class="list">
<a class="item item-icon-left item-icon-right" ng-repeat="item in list"
ng-if="!item.isWallet && item.recipientType != 'wallet'" ng-click="goToAmount(item)">
<i class="icon big-icon-svg">
<gravatar class="send-gravatar" name="{{item.name}}" width="40" email="{{item.email}}"></gravatar>
</i>
{{item.name}}
<p>
<span>{{item.displayCoin}}</span>
</p>
<i class="icon bp-arrow-right"></i>
</a>
<div class="show-more" ng-if="contactsShowMore" ng-click="showMore()" translate>
Show more
</div>
</div>
</div>
</div>
</div>
<!--<div class="card" ng-if="showTransferCard && hasFunds">-->
<!--<div class="item item-icon-right item-heading" ng-click="toggle('transferToWallet')">-->
<!--<span translate>Transfer to Wallet</span>-->
<!--<i class="icon bp-arrow-up" ng-show="sectionDisplay.transferToWallet"></i>-->
<!--<i class="icon bp-arrow-down" ng-show="!sectionDisplay.transferToWallet"></i>-->
<!--</div>-->
<!--<div class="list" ng-show="sectionDisplay.transferToWallet">-->
<!--<a class="item item-icon-left item-icon-right"-->
<!--ng-repeat="item in list"-->
<!--ng-if="hasWallets && item.recipientType == 'wallet'"-->
<!--ng-click="goToAmount(item)">-->
<!--<i class="icon big-icon-svg" ng-if="item.recipientType == 'wallet'" ng-init="wallet = item"-->
<!--ng-include="'views/includes/walletIcon.html'"></i>-->
<!--{{item.name}}-->
<!--<p>-->
<!--<span>{{item.balanceString}}</span>-->
<!--</p>-->
<!--<i class="icon bp-arrow-right"></i>-->
<!--</a>-->
<!--</div>-->
<!--</div>-->
</ion-content>
</ion-view>

View file

@ -3,15 +3,57 @@
<ion-nav-title>{{'Send' | translate}}</ion-nav-title>
</ion-nav-bar>
<ion-content>
<div ng-if="hasFunds">
<div class="send-header-wrapper">
<div class="item item-heading send-heading"><span translate>Recipient</span></div>
<div class="item input search-wrapper" ng-class="{'focus': searchFocus}">
<i class="icon icon-svg abs-v-center icon-bitcoinlogoplain"></i>
<div class="item-icon-right">
<input type="text" class="search-input" placeholder="{{'Search or enter bitcoin address' | translate}}" ng-model="formData.search" ng-change="findContact(formData.search)" ng-model-onblur ng-focus="searchInFocus()" ng-blur="searchBlurred()">
<i class="icon icon-svg qr abs-v-center separator-left" on-tap="openScanner()"><img src="img/scan-ico.svg"></i>
<div class="send-wrapper item">
<div class="row">
<div class="input" ng-class="{'focus': searchFocus}">
<input type="text" class="search-input" placeholder="{{'Search or enter bitcoin address' | translate}}"
ng-model="formData.search" ng-change="findContact(formData.search)" ng-model-onblur
ng-focus="searchInFocus()" ng-blur="searchBlurred()">
</div>
</div>
<div class="buttons">
<div class="row">
<div class="col-40">
<button class="button button-standard button-primary button-outline button-clipboard-paste" ng-click="pasteClipboard()" ng-class="{'contains-address': clipboardHasAddress, 'contains-content': clipboardHasContent}">
<span class="icon"></span><br/>
<span class="non-address" translate>Paste Clipboard</span>
<span class="address" translate>Paste Address</span>
</button>
</div>
<div class="col-60">
<button class="button button-standard button-primary button-outline">
<img src="img/icon-w2w.svg"/><br/>
<span translate>Wallet to Wallet Transfer</span>
</button>
</div>
</div>
<div class="row">
<button class="button button-standard button-green button-qr" ui-sref="tabs.scan">
<span>
<img src="img/icon-scan-qr.svg"/>
<span translate>Scan QR Code</span>
</span>
</button>
</div>
</div>
</div>
</div>
<div ng-if="hasWallets && hasFunds && !hasContacts">
<div class="list sendTip">
<div class="title" translate>
Send Bitcoin faster!
</div>
<div class="subtitle">
<div ng-show="hasWallets" translate>
<p>Save frequently used addresses and send them Bitcoin in just one tap</p>
</div>
<div class="padding buttons">
<a class="button-first-contact" ng-click="addContact()">
<img src="img/icon-contact-add.svg"/>
<span translate>Add your first contact</span>
</a>
</div>
</div>
</div>
@ -19,72 +61,83 @@
<div ng-if="!checkingBalance && (!hasFunds || !hasWallets)">
<div class="list card sendTip">
<div class="item item-icon-right item-heading"></div>
<div>
<i class="icon zero-state-icon">
<img src="img/tab-icons/ico-send-selected.svg"/>
</i>
</div>
<div class="title" translate>
Start sending bitcoin
Your Bitcoin wallet is empty
</div>
<div class="subtitle">
<span ng-show="hasWallets" translate>To get started, buy bitcoin or share your address. You can receive bitcoin from any wallet or service.</span>
<span ng-show="!hasWallets" translate>To get started, you'll need to create a bitcoin wallet and get some bitcoin.</span>
<div class="padding">
<button class="button button-standard button-primary" ng-click="buyBitcoin()" ng-show="hasWallets" translate>Buy Bitcoin</button>
<button class="button button-standard button-primary" ng-click="createWallet()" ng-show="!hasWallets" translate>Create bitcoin wallet</button>
<button class="button button-standard button-secondary" ui-sref="tabs.receive" ng-show="hasWallets" translate>Show bitcoin address</button>
<div ng-show="hasWallets" translate>
<p>To get started, buy Bitcoin Cash (BCH) or Bitcoin Core (BTC), or share your address.</p>
<p>You can receive bitcoin from any wallet or service.</p>
</div>
<div ng-show="!hasWallets" translate>To get started, you'll need to create a bitcoin wallet and get some
bitcoin.
</div>
<div class="padding buttons">
<button class="button button-standard button-green" ng-click="buyBitcoin()" ng-show="hasWallets" translate>
Buy Bitcoin now
</button>
<button class="button button-standard button-green" ng-click="createWallet()" ng-show="!hasWallets"
translate>Create bitcoin wallet
</button>
<button class="button button-standard button-white" ui-sref="tabs.receive" ng-show="hasWallets" translate>
Show my address
</button>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="card contacts" ng-if="hasContacts && hasWallets && hasFunds">
<div class="item item-icon-right item-heading">
<div translate>Contacts</div>
<div translate class="subtitle"><span style="">Saved frequently used addresses</span></div>
<a ng-if="hasContacts" ui-sref="tabs.send.addressbook">
<i class="icon ion-ios-plus-empty list-add-button"></i>
</a>
</div>
<div class="list">
<a class="item item-icon-left item-icon-right" ng-repeat="item in list"
ng-if="!item.isWallet && item.recipientType != 'wallet'" ng-click="goToAmount(item)">
<i class="icon big-icon-svg">
<gravatar class="send-gravatar" name="{{item.name}}" width="40" email="{{item.email}}"></gravatar>
</i>
{{item.name}}
<p>
<span>{{item.displayCoin}}</span>
</p>
<i class="icon bp-arrow-right"></i>
</a>
<div class="show-more" ng-if="contactsShowMore" ng-click="showMore()" translate>
Show more
</div>
</div>
</div>
</div>
</div>
<div class="card" ng-if="hasContacts && hasWallets && hasFunds">
<div class="item item-icon-right item-heading">
<span translate>Contacts</span>
<a ng-if="hasContacts" ui-sref="tabs.send.addressbook">
<i class="icon ion-ios-plus-empty list-add-button"></i>
</a>
</div>
<div class="list">
<a class="item item-icon-left item-icon-right" ng-repeat="item in list" ng-if="!item.isWallet && item.recipientType != 'wallet'" ng-click="goToAmount(item)">
<i class="icon big-icon-svg">
<img src="img/contact-placeholder.svg" class="bg" ng-if="isChromeApp">
<gravatar class="send-gravatar" name="{{item.name}}" width="30" email="{{item.email}}" ng-if="!isChromeApp"></gravatar>
</i>
{{item.name}}
<p>
<span>{{item.displayCoin}}</span>
</p>
<i class="icon bp-arrow-right"></i>
</a>
<div class="show-more" ng-if="contactsShowMore" ng-click="showMore()" translate>
Show more
</div>
</div>
</div>
<div class="card" ng-if="showTransferCard && hasFunds">
<div class="item item-icon-right item-heading" ng-click="toggle('transferToWallet')">
<span translate>Transfer to Wallet</span>
<i class="icon bp-arrow-up" ng-show="sectionDisplay.transferToWallet"></i>
<i class="icon bp-arrow-down" ng-show="!sectionDisplay.transferToWallet"></i>
</div>
<div class="list" ng-show="sectionDisplay.transferToWallet">
<a class="item item-icon-left item-icon-right"
ng-repeat="item in list"
ng-if="hasWallets && item.recipientType == 'wallet'"
ng-click="goToAmount(item)">
<i class="icon big-icon-svg" ng-if="item.recipientType == 'wallet'" ng-init="wallet = item" ng-include="'views/includes/walletIcon.html'"></i>
{{item.name}}
<p>
<span>{{item.balanceString}}</span>
</p>
<i class="icon bp-arrow-right"></i>
</a>
</div>
</div>
<!--<div class="card" ng-if="showTransferCard && hasFunds">-->
<!--<div class="item item-icon-right item-heading" ng-click="toggle('transferToWallet')">-->
<!--<span translate>Transfer to Wallet</span>-->
<!--<i class="icon bp-arrow-up" ng-show="sectionDisplay.transferToWallet"></i>-->
<!--<i class="icon bp-arrow-down" ng-show="!sectionDisplay.transferToWallet"></i>-->
<!--</div>-->
<!--<div class="list" ng-show="sectionDisplay.transferToWallet">-->
<!--<a class="item item-icon-left item-icon-right"-->
<!--ng-repeat="item in list"-->
<!--ng-if="hasWallets && item.recipientType == 'wallet'"-->
<!--ng-click="goToAmount(item)">-->
<!--<i class="icon big-icon-svg" ng-if="item.recipientType == 'wallet'" ng-init="wallet = item"-->
<!--ng-include="'views/includes/walletIcon.html'"></i>-->
<!--{{item.name}}-->
<!--<p>-->
<!--<span>{{item.balanceString}}</span>-->
<!--</p>-->
<!--<i class="icon bp-arrow-right"></i>-->
<!--</a>-->
<!--</div>-->
<!--</div>-->
</ion-content>
</ion-view>