Show open/closed proposals
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
<ul>
|
||||
{{#each proposals as |proposal|}}
|
||||
<li>
|
||||
Issue{{#if proposal.executed}}d{{/if}}
|
||||
<span class="amount">{{proposal.amount}}</span>
|
||||
<span class="symbol">₭S</span>
|
||||
to
|
||||
<span class="recipient">{{proposal.recipientName}}</span>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
@@ -5,6 +5,7 @@ export default Ember.Object.extend({
|
||||
github_username: null,
|
||||
github_uid: null,
|
||||
kredits: null,
|
||||
address: null,
|
||||
|
||||
avatarURL: function() {
|
||||
return `https\:\/\/avatars2.githubusercontent.com/u/${this.get('github_uid')}?v=3&s=128`;
|
||||
|
||||
@@ -13,6 +13,26 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{{#if proposalsOpen}}
|
||||
<section id="proposals-open">
|
||||
<header>
|
||||
<h2>Open Proposals</h2>
|
||||
</header>
|
||||
<div class="content">
|
||||
{{proposal-list proposals=proposalsOpen}}
|
||||
</div>
|
||||
</section>
|
||||
{{/if}}
|
||||
|
||||
<section id="proposals-closed">
|
||||
<header>
|
||||
<h2>Closed Proposals</h2>
|
||||
</header>
|
||||
<div class="content">
|
||||
{{proposal-list proposals=proposalsClosed}}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{{#if contractInteractionEnabled}}
|
||||
<section id="add-contributor">
|
||||
<header>
|
||||
|
||||
Reference in New Issue
Block a user