Sort all data
This commit is contained in:
@@ -13,6 +13,11 @@ export default Ember.Controller.extend({
|
|||||||
|
|
||||||
contractInteractionEnabled: computed.alias('kredits.web3Provided'),
|
contractInteractionEnabled: computed.alias('kredits.web3Provided'),
|
||||||
|
|
||||||
|
findContributorByAddress(address) {
|
||||||
|
return this.get('model.contributors')
|
||||||
|
.findBy('address', address);
|
||||||
|
},
|
||||||
|
|
||||||
proposalsOpen: function() {
|
proposalsOpen: function() {
|
||||||
let proposals = this.get('model.proposals')
|
let proposals = this.get('model.proposals')
|
||||||
.filterBy('executed', false)
|
.filterBy('executed', false)
|
||||||
@@ -33,10 +38,12 @@ export default Ember.Controller.extend({
|
|||||||
return proposals;
|
return proposals;
|
||||||
}.property('model.proposals.[]', 'model.contributors.[]'),
|
}.property('model.proposals.[]', 'model.contributors.[]'),
|
||||||
|
|
||||||
findContributorByAddress(address) {
|
proposalsSorting: ['id:desc'],
|
||||||
return this.get('model.contributors')
|
proposalsClosedSorted: Ember.computed.sort('proposalsClosed', 'proposalsSorting'),
|
||||||
.findBy('address', address);
|
proposalsOpenSorted: Ember.computed.sort('proposalsOpen', 'proposalsSorting'),
|
||||||
},
|
|
||||||
|
contributorsSorting: ['kredits:desc'],
|
||||||
|
contributorsSorted: Ember.computed.sort('model.contributors', 'contributorsSorting'),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
{{contributor-list contributors=model.contributors}}
|
{{contributor-list contributors=contributorsSorted}}
|
||||||
|
|
||||||
<p class="stats">
|
<p class="stats">
|
||||||
<span class="number">{{model.totalSupply}}</span> kredits issued and distributed among
|
<span class="number">{{model.totalSupply}}</span> kredits issued and distributed among
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<h2>Open Proposals</h2>
|
<h2>Open Proposals</h2>
|
||||||
</header>
|
</header>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
{{proposal-list proposals=proposalsOpen confirmAction="confirmProposal"}}
|
{{proposal-list proposals=proposalsOpenSorted confirmAction="confirmProposal"}}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<h2>Closed Proposals</h2>
|
<h2>Closed Proposals</h2>
|
||||||
</header>
|
</header>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
{{proposal-list proposals=proposalsClosed confirmAction="confirmProposal"}}
|
{{proposal-list proposals=proposalsClosedSorted confirmAction="confirmProposal"}}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user