Fix txp modals

This commit is contained in:
Gustavo Maximiliano Cortez 2016-09-27 12:57:46 -03:00
commit 2efe47c016
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
5 changed files with 48 additions and 42 deletions

View file

@ -3,7 +3,7 @@
<button class="button button-clear" ng-click="cancel()"> <button class="button button-clear" ng-click="cancel()">
{{'Close' | translate}} {{'Close' | translate}}
</button> </button>
<div class="title" translate> <div class="title">
{{title}} {{title}}
</div> </div>
</ion-header-bar> </ion-header-bar>
@ -16,25 +16,26 @@
<img src="img/icon-wallet.svg" ng-style="{'background-color': color}" class="bg"/> <img src="img/icon-wallet.svg" ng-style="{'background-color': color}" class="bg"/>
</i> </i>
<div class="size-36" copy-to-clipboard="btx.amountStr"> <div class="size-36 m20t" copy-to-clipboard="btx.amountStr">
<span class="enable_text_select">{{btx.amountStr}}</span> {{btx.amountStr}}
</div> </div>
<div class="alternative-amount" ng-click="showRate =! showRate"> <div class="m10t" style="height:20px;" ng-click="showRate =! showRate">
<span class="label gray radius" ng-show="!showRate && alternativeAmountStr"> <span ng-show="!showRate && alternativeAmountStr">
{{alternativeAmountStr}} {{alternativeAmountStr}}
</span> </span>
<span class="size-12" ng-show="showRate && alternativeAmountStr"> <span ng-show="showRate && alternativeAmountStr">
{{rateStr}} ({{rateDate | amDateFormat:'MM/DD/YYYY HH:mm a'}}) {{rateStr}} ({{rateDate | amDateFormat:'MM/DD/YYYY HH:mm a'}})
</span> </span>
</div> </div>
</div> </div>
<div ng-show="btx.action == 'sent'"> <div ng-show="btx.action == 'sent'">
<span translate>Sent from</span> {{wallet.credentials.walletName}} <div>
<div class="padding-vertical"> <span translate>Sent from</span>
<i class="icon ion-ios-arrow-thin-down size-24"></i> <strong ng-style="{'color': color}">{{wallet.credentials.walletName}}</strong>
</div> </div>
<i class="icon ion-ios-arrow-thin-down size-24"></i>
</div> </div>
<div ng-show="btx.action == 'received'"> <div ng-show="btx.action == 'received'">
@ -63,27 +64,26 @@
</span> </span>
<span ng-if="!btx.merchant"> <span ng-if="!btx.merchant">
<span ng-show="btx.labelTo">{{btx.labelTo}}</span> <span ng-show="btx.labelTo">{{btx.labelTo}}</span>
<contact ng-show="!btx.labelTo" class="enable_text_select" address="{{btx.addressTo}}"></contact> <contact ng-show="!btx.labelTo" address="{{btx.addressTo}}"></contact>
</span> </span>
</div> </div>
</div> </div>
<div class="item item-icon-left" ng-click="openExternalLink('https://' + <div class="item item-icon-left"
(getShortNetworkName() == 'test' ? 'test-' : '') + 'insight.bitpay.com/tx/' + btx.txid)"> ng-click="openExternalLink('https://' + (getShortNetworkName() == 'test' ? 'test-' : '') + 'insight.bitpay.com/tx/' + btx.txid)">
<i class="icon ion-ios-upload-outline"></i> <i class="icon ion-ios-upload-outline"></i>
<span class="text-gray" translate>View transaction on the blockchain</span> <span class="text-gray" translate>View transaction on the blockchain</span>
</div> </div>
<div class="item"> <div class="item">
<div ng-if="btx.action == 'received' || 'moved'"> <div ng-if="btx.action == 'received' || btx.action == 'moved'">
<span translate>Date</span> {{'Date'|translate}}
<span class="item-note"> <span class="item-note">
<time>{{ btx.time * 1000 | amDateFormat:'MM/DD/YYYY HH:mm a'}}</time> <time>{{ btx.time * 1000 | amDateFormat:'MM/DD/YYYY HH:mm a'}}</time>
</span> </span>
</div> </div>
<div ng-if="btx.action == 'sent'"> <div ng-if="btx.action == 'sent'">
<div translate>Created by</div> {{'Created by'|translate}} <strong>{{btx.creatorName}}</strong>
<span>{{btx.creatorName}}</span>
<span class="item-note"> <span class="item-note">
<time>{{ btx.createdOn * 1000 | amDateFormat:'MM/DD/YYYY HH:mm a'}}</time> <time>{{ btx.createdOn * 1000 | amDateFormat:'MM/DD/YYYY HH:mm a'}}</time>
</span> </span>
@ -91,9 +91,8 @@
</div> </div>
<div class="item" ng-if="btx.action != 'received' && btx.feeLevel" copy-to-clipboard="btx.feeStr"> <div class="item" ng-if="btx.action != 'received' && btx.feeLevel" copy-to-clipboard="btx.feeStr">
<div translate>Fee</div> {{'Fee'|translate}}: {{btx.feeStr}}
<span class="enable_text_select">{{btx.feeLevel}} ({{btx.feeStr}})</span> <span class="item-note">
<span class="right">
<span class="text-warning" ng-show="!btx.confirmations || btx.confirmations == 0" translate> <span class="text-warning" ng-show="!btx.confirmations || btx.confirmations == 0" translate>
Unconfirmed Unconfirmed
</span> </span>
@ -108,20 +107,23 @@
</div> </div>
<div class="item" ng-if="btx.message && btx.action != 'received'" copy-to-clipboard="btx.message"> <div class="item" ng-if="btx.message && btx.action != 'received'" copy-to-clipboard="btx.message">
<div translate>Description</div> {{'Description'|translate}}
<span class="enable_text_select">{{btx.message}}</span> <span class="item-note">
{{btx.message}}
</span>
</div> </div>
<div ng-if="btx.merchant" class="item" copy-to-clipboard="btx.merchant.pr.pd.memo"> <div ng-if="btx.merchant" class="item" copy-to-clipboard="btx.merchant.pr.pd.memo">
<div translate>Merchant message</div> {{'Merchant message'|translate}}
<span class="enable_text_select"> <span class="item-note">
{{btx.merchant.pr.pd.memo}} {{btx.merchant.pr.pd.memo}}
</span> </span>
</div> </div>
<div ng-show="btx.hasMultiplesOutputs" class="item" ng-click="showMultiplesOutputs = !showMultiplesOutputs"> <div ng-show="btx.hasMultiplesOutputs" class="item" ng-click="showMultiplesOutputs = !showMultiplesOutputs">
<div translate>Recipients</div> {{'Recipients'|translate}}
<span class="right">{{btx.recipientCount}} <span class="item-note">
{{btx.recipientCount}}
<i ng-show="showMultiplesOutputs" class="icon-arrow-up3 size-24"></i> <i ng-show="showMultiplesOutputs" class="icon-arrow-up3 size-24"></i>
<i ng-show="!showMultiplesOutputs" class="icon-arrow-down3 size-24"></i> <i ng-show="!showMultiplesOutputs" class="icon-arrow-down3 size-24"></i>
</span> </span>
@ -138,21 +140,22 @@
</span> </span>
</div> </div>
<div class="item item-icon-right" ng-click="showCommentPopup()"> <div class="item" ng-click="showCommentPopup()">
<span class="text-gray" translate ng-if="!btx.note">Add Memo</i></span> {{'Memo'|translate}}
<span class="text-gray" translate ng-if="btx.note">Memo</span> <span class="item-note" translate ng-if="!btx.note">
<div ng-if="btx.note && btx.note.body"> <i class="icon ion-ios-plus-empty"></i>
<span class="enable_text_select">{{btx.note.body}}</span><br> </span>
<span class="text-italic item-note size-12"> <span class="item-note" ng-if="btx.note && btx.note.body">
<span translate>Edited by</span> <span>{{btx.note.editedByName}}</span>, {{btx.note.body}}
<time>{{btx.note.editedOn * 1000 | amTimeAgo}}</time></span> <div>
</span> <span translate>Edited by</span> {{btx.note.editedByName}},
</div> <time>{{btx.note.editedOn * 1000 | amTimeAgo}}</time>
</div>
</span>
</div> </div>
<div ng-if="actionList[0]"> <div ng-if="actionList[0]">
<div class="item item-divider" translate>Timeline</div> <div class="item item-divider" translate>Timeline</div>
<div class="item" ng-class="{'action-created' : a.type == 'created' || a.type == 'accept', 'action-rejected' : a.type == 'reject'}" ng-repeat="a in actionList track by $index"> <div class="item" ng-class="{'action-created' : a.type == 'created' || a.type == 'accept', 'action-rejected' : a.type == 'reject'}" ng-repeat="a in actionList track by $index">
<div class="row"> <div class="row">
<div class="col col-10"> <div class="col col-10">

View file

@ -53,7 +53,7 @@
<span translate>To</span> <span translate>To</span>
<span class="payment-proposal-to" copy-to-clipboard="tx.toAddress"> <span class="payment-proposal-to" copy-to-clipboard="tx.toAddress">
<i class="icon ion-social-bitcoin"></i> <i class="icon ion-social-bitcoin"></i>
<contact ng-if="!tx.hasMultiplesOutputs" class="enable_text_select ellipsis" address="{{tx.toAddress}}"></contact> <contact ng-if="!tx.hasMultiplesOutputs" class="ellipsis" address="{{tx.toAddress}}"></contact>
<span ng-if="tx.hasMultiplesOutputs" translate>Multiple recipients</span> <span ng-if="tx.hasMultiplesOutputs" translate>Multiple recipients</span>
</span> </span>
</div> </div>

View file

@ -26,7 +26,7 @@
Payment Proposals Payment Proposals
<i class="icon nav-item-arrow-right"></i> <i class="icon nav-item-arrow-right"></i>
<span class="badge badge-assertive" ng-show="txpsN>3" translate> {{txpsN}}</span> <span class="badge badge-assertive m5t m10r" ng-show="txpsN>3" translate> {{txpsN}}</span>
</a> </a>
<a ng-repeat="tx in txps" class="item" ng-click="openTxpModal(tx)"> <a ng-repeat="tx in txps" class="item" ng-click="openTxpModal(tx)">

View file

@ -126,6 +126,9 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
$scope.rateDate = res.fetchedOn; $scope.rateDate = res.fetchedOn;
$scope.rateStr = res.rate + ' ' + $scope.alternativeIsoCode; $scope.rateStr = res.rate + ' ' + $scope.alternativeIsoCode;
$scope.alternativeAmountStr = $filter('formatFiatAmount')(alternativeAmountBtc * res.rate) + ' ' + $scope.alternativeIsoCode; $scope.alternativeAmountStr = $filter('formatFiatAmount')(alternativeAmountBtc * res.rate) + ' ' + $scope.alternativeIsoCode;
$timeout(function() {
$scope.$apply();
});
} }
}); });
}; };

View file

@ -7,6 +7,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
var isGlidera = $scope.isGlidera; var isGlidera = $scope.isGlidera;
var GLIDERA_LOCK_TIME = 6 * 60 * 60; var GLIDERA_LOCK_TIME = 6 * 60 * 60;
var now = Math.floor(Date.now() / 1000); var now = Math.floor(Date.now() / 1000);
var countDown;
$scope.init = function() { $scope.init = function() {
$scope.loading = null; $scope.loading = null;
@ -18,6 +19,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
$scope.data = {}; $scope.data = {};
initActionList(); initActionList();
checkPaypro();
} }
function initActionList() { function initActionList() {
@ -53,8 +55,6 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
$scope.sign(); $scope.sign();
}); });
checkPaypro();
// ToDo: use tx.customData instead of tx.message // ToDo: use tx.customData instead of tx.message
if (tx.message === 'Glidera transaction' && isGlidera) { if (tx.message === 'Glidera transaction' && isGlidera) {
tx.isGlidera = true; tx.isGlidera = true;
@ -154,7 +154,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
$scope.paymentExpired = false; $scope.paymentExpired = false;
setExpirationTime(); setExpirationTime();
self.countDown = $interval(function() { countDown = $interval(function() {
setExpirationTime(); setExpirationTime();
}, 1000); }, 1000);
@ -162,7 +162,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
var now = Math.floor(Date.now() / 1000); var now = Math.floor(Date.now() / 1000);
if (now > expirationTime) { if (now > expirationTime) {
$scope.paymentExpired = true; $scope.paymentExpired = true;
if (self.countDown) $interval.cancel(self.countDown); if (countDown) $interval.cancel(countDown);
return; return;
} }
var totalSecs = expirationTime - now; var totalSecs = expirationTime - now;