Adds more fee data to the confirmation popup

This commit is contained in:
Gustavo Maximiliano Cortez 2016-02-29 18:14:47 -03:00
parent b720821d4e
commit 82bcfd8d30
No known key found for this signature in database
GPG Key ID: 15EDAD8D9F2EB1AF
4 changed files with 22 additions and 5 deletions

View File

@ -7,7 +7,7 @@
</div> </div>
<div class="p10"> <div class="p10">
<div class="size-36">{{tx.amountStr}}</div> <div class="size-36">{{tx.amountStr}}</div>
<div class="size-14 text-light" ng-show="tx.alternativeAmountStr">{{tx.alternativeAmountStr}}</div> <div class="size-12 label gray radius" ng-show="tx.alternativeAmountStr">{{tx.alternativeAmountStr}}</div>
<i class="db fi-arrow-down size-24 m10v"></i> <i class="db fi-arrow-down size-24 m10v"></i>
<div class="payment-proposal-to" ng-click="copyToClipboard(tx.toAddress)"> <div class="payment-proposal-to" ng-click="copyToClipboard(tx.toAddress)">
<i class="fi-bitcoin left m10l"></i> <i class="fi-bitcoin left m10l"></i>
@ -16,8 +16,15 @@
Multiple recipients Multiple recipients
</span> </span>
</div> </div>
<div class="text-bold m10t size-12"> <div class="text-bold m10t size-12" ng-init="confirm.processFee(tx.amount, tx.fee)">
<div ng-show="!showPercentage" ng-click="showPercentage = true">
<span translate>Fee</span>: {{tx.feeStr}} <span translate>Fee</span>: {{tx.feeStr}}
<span class="label gray radius">{{confirm.feeAlternativeStr}}</span>
</div>
<div ng-show="showPercentage" ng-click="showPercentage = false" translate>
{{confirm.feeLevel|translate}} &middot;
{{confirm.feeRateStr}} of the transaction
</div>
</div> </div>
<div class="row m20t"> <div class="row m20t">
<div class="large-6 medium-6 small-6 columns"> <div class="large-6 medium-6 small-6 columns">

View File

@ -652,6 +652,7 @@ input[type=number]::-webkit-outer-spin-button {
.label { .label {
font-weight: 500; font-weight: 500;
padding: 0.3rem 0.4rem; padding: 0.3rem 0.4rem;
vertical-align: text-bottom;
} }
.label.outline { .label.outline {

View File

@ -1,6 +1,16 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('confirmTxController', function() { angular.module('copayApp.controllers').controller('confirmTxController', function(configService, feeService, rateService) {
this.processFee = function(amount, fee) {
var walletSettings = configService.getSync().wallet.settings;
var feeAlternativeIsoCode = walletSettings.alternativeIsoCode;
this.feeLevel = feeService.feeOpts[feeService.getCurrentFeeLevel()];
this.feeAlternativeStr = parseFloat((rateService.toFiat(fee, feeAlternativeIsoCode)).toFixed(2), 10) + ' ' + feeAlternativeIsoCode;
this.feeRateStr = (fee / amount * 100).toFixed(2) + '%' ;
};
this.close = function(cb) { this.close = function(cb) {
return cb(); return cb();

View File

@ -15,7 +15,6 @@ angular.module('copayApp.controllers').controller('txController',
this.copayerId = fc.credentials.copayerId; this.copayerId = fc.credentials.copayerId;
this.isShared = fc.credentials.n > 1; this.isShared = fc.credentials.n > 1;
if (isCordova) { if (isCordova) {
$rootScope.modalOpened = true; $rootScope.modalOpened = true;
var self = this; var self = this;