- {{#link-to 'proposals.new'}}Create new proposal{{/link-to}} -
- {{/if}} + {{contribution-list contributions=model.contributions + contributors=model.contributors}}diff --git a/app/components/contribution-list/component.js b/app/components/contribution-list/component.js new file mode 100644 index 0000000..2945701 --- /dev/null +++ b/app/components/contribution-list/component.js @@ -0,0 +1,16 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({ + + tagName: 'ul', + classNames: ['contribution-list'], + + contributionsWithContributors: function() { + return this.get('contributions').map((c) => { + c.set('contributor', this.get('contributors') + .findBy('address', c.get('recipientAddress'))); + return c; + }); + }.property('contributions.@each') + +}); diff --git a/app/components/contribution-list/template.hbs b/app/components/contribution-list/template.hbs new file mode 100644 index 0000000..691a486 --- /dev/null +++ b/app/components/contribution-list/template.hbs @@ -0,0 +1,7 @@ +{{#each contributionsWithContributors as |contribution|}} +
- {{#link-to 'proposals.new'}}Create new proposal{{/link-to}} -
- {{/if}} + {{contribution-list contributions=model.contributions + contributors=model.contributors}}