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|}} +
  • + + {{contribution.amount}}₭S + for {{contribution.contributor.name}} +
  • +{{/each}} diff --git a/app/models/contribution.js b/app/models/contribution.js index 454d6ad..2b02e83 100644 --- a/app/models/contribution.js +++ b/app/models/contribution.js @@ -10,6 +10,7 @@ export default Ember.Object.extend({ ipfsHash: null, amount: null, + contributor: null, contribution: null, kind: null, description: null, diff --git a/app/styles/app.scss b/app/styles/app.scss index afca809..472c799 100644 --- a/app/styles/app.scss +++ b/app/styles/app.scss @@ -104,3 +104,4 @@ button, input[type=submit] { @import "components/contributor-list"; @import "components/add-contributor"; @import "components/proposal-list"; +@import "components/contribution-list"; diff --git a/app/styles/components/_contribution-list.scss b/app/styles/components/_contribution-list.scss new file mode 100644 index 0000000..411ee5f --- /dev/null +++ b/app/styles/components/_contribution-list.scss @@ -0,0 +1,39 @@ +ul.contribution-list { + clear: both; + width: 100%; + list-style: none; + + li { + // display: block; + padding: 0 1.2rem; + line-height: 4.2rem; + background-color: rgba(255,255,255,0.1); + font-size: 1.4rem; + border-bottom: 1px solid rgba(255,255,255,0.2); + &:first-of-type { + border-top: 1px solid rgba(255,255,255,0.2); + } + + .category { + color: $blue; + padding-right: 0.2rem; + &.community { color: $red; } + &.dev { color: $pink; } + &.design { color: $yellow; } + &.docs { color: $green; } + &.ops { color: $purple; } + } + .amount { + font-weight: 500; + } + .symbol { + font-size: 1rem; + font-weight: 500; + padding-left: 0.2rem; + } + .recipient { + font-weight: 500; + } + } + +} diff --git a/app/templates/index.hbs b/app/templates/index.hbs index 23f9a8a..a9a2ddd 100644 --- a/app/templates/index.hbs +++ b/app/templates/index.hbs @@ -32,19 +32,13 @@ {{/if}} -
    +
    -

    Closed Proposals

    +

    Contributions

    - {{proposal-list proposals=proposalsClosedSorted - confirmAction="confirmProposal"}} - - {{#if contractInteractionEnabled}} -

    - {{#link-to 'proposals.new'}}Create new proposal{{/link-to}} -

    - {{/if}} + {{contribution-list contributions=model.contributions + contributors=model.contributors}}