Sort all data
This commit is contained in:
@@ -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: {
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
</header>
|
||||
|
||||
<div class="content">
|
||||
{{contributor-list contributors=model.contributors}}
|
||||
{{contributor-list contributors=contributorsSorted}}
|
||||
|
||||
<p class="stats">
|
||||
<span class="number">{{model.totalSupply}}</span> kredits issued and distributed among
|
||||
@@ -20,7 +20,7 @@
|
||||
<h2>Open Proposals</h2>
|
||||
</header>
|
||||
<div class="content">
|
||||
{{proposal-list proposals=proposalsOpen confirmAction="confirmProposal"}}
|
||||
{{proposal-list proposals=proposalsOpenSorted confirmAction="confirmProposal"}}
|
||||
</div>
|
||||
</section>
|
||||
{{/if}}
|
||||
@@ -30,7 +30,7 @@
|
||||
<h2>Closed Proposals</h2>
|
||||
</header>
|
||||
<div class="content">
|
||||
{{proposal-list proposals=proposalsClosed confirmAction="confirmProposal"}}
|
||||
{{proposal-list proposals=proposalsClosedSorted confirmAction="confirmProposal"}}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user