Allow addons to use custom template for proposal row on home screen.

This commit is contained in:
Kosta Korenkov 2015-08-11 17:40:24 +03:00
commit f41be9f4e5
3 changed files with 7 additions and 2 deletions

View file

@ -164,7 +164,7 @@
<div ng-show="index.requiresMultipleSignatures">
<h4 class="title m0" translate>Payment Proposals</h4>
<div class="last-transactions pr" ng-repeat="tx in index.txps"
ng-include="'views/includes/transaction.html'">
ng-include="index.txTemplateUrl">
</div>
<div class="text-gray text-center size-12 p10t"
@ -179,7 +179,7 @@
<div ng-show="!index.requiresMultipleSignatures">
<h4 class="title m0" translate>Unsent transactions</h4>
<div class="last-transactions pr" ng-repeat="tx in index.txps"
ng-include="'views/includes/transaction.html'">
ng-include="index.txTemplateUrl">
</div>
</div>
</div>

View file

@ -35,6 +35,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.addonViews = addonManager.addonViews();
self.menu = self.menu.concat(addonManager.addonMenuItems());
self.menuItemSize = self.menu.length > 5 ? 2 : 3;
self.txTemplateUrl = addonManager.txTemplateUrl() || 'views/includes/transaction.html';
self.tab = 'walletHome';

View file

@ -27,4 +27,8 @@ angular.module('copayApp.services').service('addonManager', function (lodash) {
});
};
this.txTemplateUrl = function() {
var addon = lodash.find(addons, 'txTemplateUrl');
return addon ? addon.txTemplateUrl() : null;
}
});