Sort all data

This commit is contained in:
2017-02-05 17:56:14 +08:00
parent 79412e2032
commit a7bfa3e45c
2 changed files with 14 additions and 7 deletions
+11 -4
View File
@@ -13,6 +13,11 @@ export default Ember.Controller.extend({
contractInteractionEnabled: computed.alias('kredits.web3Provided'),
findContributorByAddress(address) {
return this.get('model.contributors')
.findBy('address', address);
},
proposalsOpen: function() {
let proposals = this.get('model.proposals')
.filterBy('executed', false)
@@ -33,10 +38,12 @@ export default Ember.Controller.extend({
return proposals;
}.property('model.proposals.[]', 'model.contributors.[]'),
findContributorByAddress(address) {
return this.get('model.contributors')
.findBy('address', address);
},
proposalsSorting: ['id:desc'],
proposalsClosedSorted: Ember.computed.sort('proposalsClosed', 'proposalsSorting'),
proposalsOpenSorted: Ember.computed.sort('proposalsOpen', 'proposalsSorting'),
contributorsSorting: ['kredits:desc'],
contributorsSorted: Ember.computed.sort('model.contributors', 'contributorsSorting'),
actions: {