diff --git a/app/components/proposal-list/component.js b/app/components/proposal-list/component.js
new file mode 100644
index 0000000..47cb2d4
--- /dev/null
+++ b/app/components/proposal-list/component.js
@@ -0,0 +1,5 @@
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+
+});
diff --git a/app/components/proposal-list/template.hbs b/app/components/proposal-list/template.hbs
new file mode 100644
index 0000000..4e45070
--- /dev/null
+++ b/app/components/proposal-list/template.hbs
@@ -0,0 +1,11 @@
+
+ {{#each proposals as |proposal|}}
+ -
+ Issue{{#if proposal.executed}}d{{/if}}
+ {{proposal.amount}}
+ ₭S
+ to
+ {{proposal.recipientName}}
+
+ {{/each}}
+
diff --git a/app/controllers/index.js b/app/controllers/index.js
index d687d6d..6661e2a 100644
--- a/app/controllers/index.js
+++ b/app/controllers/index.js
@@ -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);
+ }
+
+
});
diff --git a/app/models/contributor.js b/app/models/contributor.js
index 3402308..07c490c 100644
--- a/app/models/contributor.js
+++ b/app/models/contributor.js
@@ -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`;
diff --git a/app/templates/index.hbs b/app/templates/index.hbs
index da91456..b50049f 100644
--- a/app/templates/index.hbs
+++ b/app/templates/index.hbs
@@ -13,6 +13,26 @@
+{{#if proposalsOpen}}
+
+
+
+ {{proposal-list proposals=proposalsOpen}}
+
+
+{{/if}}
+
+
+
+
+ {{proposal-list proposals=proposalsClosed}}
+
+
+
{{#if contractInteractionEnabled}}
diff --git a/tests/integration/components/proposal-list/component-test.js b/tests/integration/components/proposal-list/component-test.js
new file mode 100644
index 0000000..55be0bb
--- /dev/null
+++ b/tests/integration/components/proposal-list/component-test.js
@@ -0,0 +1,16 @@
+import { moduleForComponent, test } from 'ember-qunit';
+import hbs from 'htmlbars-inline-precompile';
+
+moduleForComponent('proposal-list', 'Integration | Component | proposal list', {
+ integration: true
+});
+
+test('it renders', function(assert) {
+
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.on('myAction', function(val) { ... });
+
+ this.render(hbs`{{proposal-list}}`);
+
+ assert.equal(this.$().text().trim(), '');
+});