Show open/closed proposals

This commit is contained in:
2017-02-05 15:59:41 +08:00
parent 227c6f5c4b
commit c676c6ae68
6 changed files with 79 additions and 0 deletions
+26
View File
@@ -13,4 +13,30 @@ export default Ember.Controller.extend({
contractInteractionEnabled: computed.alias('kredits.web3Provided'),
proposalsOpen: function() {
let proposals = this.get('model.proposals')
.filterBy('executed', false)
.map(p => {
p.recipientName = this.findContributorByAddress(p.recipientAddress).github_username;
return p;
});
return proposals;
}.property('model.proposals.[]', 'model.contributors.[]'),
proposalsClosed: function() {
let proposals = this.get('model.proposals')
.filterBy('executed', true)
.map(p => {
p.recipientName = this.findContributorByAddress(p.recipientAddress).github_username;
return p;
});
return proposals;
}.property('model.proposals.[]', 'model.contributors.[]'),
findContributorByAddress(address) {
return this.get('model.contributors')
.findBy('address', address);
}
});