add notpending in proposals

This commit is contained in:
Matias Alejo Garcia 2016-09-02 14:33:18 -03:00
parent d7e025c2d0
commit 8c43f55756
No known key found for this signature in database
GPG Key ID: 02470DB551277AB3
6 changed files with 54 additions and 69 deletions

View File

@ -1,23 +1,31 @@
<i class="icon ion-ios-circle-filled" ng-show="tx.pendingForUs" ng-style="{'color':tx.wallet.color}"></i>
<span ng-show="!tx.merchant">
<span ng-show="addressbook[tx.toAddress] && !tx.message">
{{addressbook[tx.toAddress]}}
</span>
<span class="ellipsis" ng-show="!addressbook[tx.toAddress] && tx.message">
{{tx.message}}
</span>
<span ng-show="!addressbook[tx.toAddress] && !tx.message" translate>
Sending
</span>
</span>
<span ng-show="tx.merchant">
<span ng-show="tx.merchant.pr.ca"><i class="fi-lock"></i> {{tx.merchant.domain}}</span>
<span ng-show="!tx.merchant.pr.ca"><i class="fi-unlock"></i> {{tx.merchant.domain}}</span>
</span>
<span>
- {{tx.amountStr}}
</span>
<div class="item-note">
{{tx.wallet.name}} &middot; <time>{{ (tx.ts || tx.createdOn ) * 1000 | amTimeAgo}}</time>
</div>
<div class="wallet-activity" ng-class="{'wallet-activity-not-pending':!tx.pendingForUs}">
<span ng-show="!tx.merchant">
<span ng-show="addressbook[tx.toAddress] && !tx.message">
{{addressbook[tx.toAddress]}}
</span>
<span class="ellipsis" ng-show="!addressbook[tx.toAddress] && tx.message">
{{tx.message}}
</span>
<span ng-show="!addressbook[tx.toAddress] && !tx.message" translate>
Sending
</span>
</span>
<span ng-show="tx.merchant">
<span ng-show="tx.merchant.pr.ca"><i class="fi-lock"></i> {{tx.merchant.domain}}</span>
<span ng-show="!tx.merchant.pr.ca"><i class="fi-unlock"></i> {{tx.merchant.domain}}</span>
</span>
<span>
</span>
<div class="wallet-activity-amount">
{{tx.amountStr}}
</div>
<p class="wallet-activity-note">
<i class="icon ion-record wallet-activity-note-child" ng-style="{'color':tx.wallet.color}"></i>
<span class="wallet-activity-note-child">{{tx.wallet.name}}</span>
<time class="wallet-activity-note-child">{{tx.createdOn * 1000 | amTimeAgo}}</time>
</p>
</div>

View File

@ -11,7 +11,7 @@
<ion-content class="padding" ng-controller="proposalsController" ng-init="init()">
<div class="list card">
<a ng-repeat="tx in txps" class="item item-icon-left" ng-click="openTxpModal(tx)">
<a ng-repeat="tx in txps" class="item" ng-click="openTxpModal(tx)">
<span ng-include="'views/includes/txp.html'"></span>
</a>

View File

@ -14,7 +14,7 @@
<span class="badge badge-assertive" ng-show="txpsN>3" translate> {{txpsN}}</span>
</a>
<a ng-repeat="tx in txps" class="item item-icon-left" ng-click="openTxpModal(tx)">
<a ng-repeat="tx in txps" class="item" ng-click="openTxpModal(tx)">
<span ng-include="'views/includes/txp.html'"></span>
</a>
</div>

View File

@ -7,17 +7,24 @@ angular.module('copayApp.controllers').controller('tabHomeController',
$scope.bitpayCardEnabled = true; // TODO
function updateTxps() {
profileService.getTxps({
limit: 3
}, function(err, txps, n) {
if (err) {
console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO
}
$scope.txps = txps;
$scope.txpsN = n;
$ionicScrollDelegate.resize();
var setPendingTxps = function(txps) {
if (!txps) {
$scope.txps = [];
return;
}
$scope.txps = lodash.sortBy(txps, 'createdOn').reverse();
$timeout(function() {
$scope.$apply();
}, 1);
})
};
$scope.updateAllWallets = function() {
$scope.wallets = profileService.getWallets();
if (lodash.isEmpty($scope.wallets)) return;
@ -35,20 +42,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
wallet.status = status;
}
if (++j==i) {
profileService.getTxps({
limit: 3
}, function(err, txps, n) {
if (err) {
console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO
}
$scope.txps = txps;
$scope.txpsN = n;
$ionicScrollDelegate.resize();
$timeout(function() {
$scope.$apply();
}, 1);
});
updateTxps();
}
});
});
@ -92,20 +86,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
}
$scope.notifications = notifications;
profileService.getTxps({
limit: 3
}, function(err, txps, n) {
if (err) {
console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO
}
$scope.txps = txps;
$scope.txpsN = n;
$ionicScrollDelegate.resize();
$timeout(function() {
$scope.$apply();
}, 1);
})
updateTxps();
})
});
};

View File

@ -908,22 +908,14 @@ angular.module('copayApp.services')
var txps = [];
function process(notifications) {
if (!notifications) return [];
var shown = lodash.sortBy(notifications, 'createdOn').reverse();
shown = shown.splice(0, opts.limit || MAX);
return shown;
};
lodash.each(w, function(x) {
if (x.pendingTxps)
txps = txps.concat(x.pendingTxps);
});
txps = lodash.sortBy(txps, 'createdOn');
txps = lodash.sortBy(txps, 'pendingForUs', 'createdOn');
txps = lodash.compact(lodash.flatten(txps)).slice(0,MAX);
var n = txps.length;
return cb(null, process(txps), n);
return cb(null, txps, n);
};
return root;

View File

@ -1,5 +1,9 @@
.wallet-activity {
&-not-pending {
background-color:#eee;
}
&-amount {
float: right;
font-size: 18px;