Rename contributor.kredits to .balance
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
{{contributor.name}}
|
{{contributor.name}}
|
||||||
</td>
|
</td>
|
||||||
<td class="kredits">
|
<td class="kredits">
|
||||||
<span class="amount">{{contributor.kredits}}</span>
|
<span class="amount">{{contributor.balance}}</span>
|
||||||
<span class="symbol">₭S</span>
|
<span class="symbol">₭S</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -40,11 +40,11 @@ export default Ember.Controller.extend({
|
|||||||
|
|
||||||
contributorsWithKredits: function() {
|
contributorsWithKredits: function() {
|
||||||
return this.get('model.contributors').filter(c => {
|
return this.get('model.contributors').filter(c => {
|
||||||
return c.get('kredits') !== 0;
|
return c.get('balance') !== 0;
|
||||||
});
|
});
|
||||||
}.property('model.contributors.@each.kredits'),
|
}.property('model.contributors.@each.balance'),
|
||||||
|
|
||||||
contributorsSorting: ['kredits:desc'],
|
contributorsSorting: ['balance:desc'],
|
||||||
contributorsSorted: Ember.computed.sort('contributorsWithKredits', 'contributorsSorting'),
|
contributorsSorted: Ember.computed.sort('contributorsWithKredits', 'contributorsSorting'),
|
||||||
|
|
||||||
watchContractEvents: function() {
|
watchContractEvents: function() {
|
||||||
@@ -112,7 +112,7 @@ export default Ember.Controller.extend({
|
|||||||
|
|
||||||
this.get('model.contributors')
|
this.get('model.contributors')
|
||||||
.findBy('address', data.args.recipient)
|
.findBy('address', data.args.recipient)
|
||||||
.incrementProperty('kredits', data.args.amount.toNumber());
|
.incrementProperty('balance', data.args.amount.toNumber());
|
||||||
},
|
},
|
||||||
|
|
||||||
_handleProposalVoted(data) {
|
_handleProposalVoted(data) {
|
||||||
@@ -124,10 +124,10 @@ export default Ember.Controller.extend({
|
|||||||
_handleTransfer(data) {
|
_handleTransfer(data) {
|
||||||
this.get('model.contributors')
|
this.get('model.contributors')
|
||||||
.findBy('address', data.args.from)
|
.findBy('address', data.args.from)
|
||||||
.incrementProperty('kredits', - data.args.value.toNumber());
|
.incrementProperty('balance', - data.args.value.toNumber());
|
||||||
this.get('model.contributors')
|
this.get('model.contributors')
|
||||||
.findBy('address', data.args.to)
|
.findBy('address', data.args.to)
|
||||||
.incrementProperty('kredits', data.args.value.toNumber());
|
.incrementProperty('balance', data.args.value.toNumber());
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export default Ember.Object.extend({
|
|||||||
github_uid: null,
|
github_uid: null,
|
||||||
wiki_username: null,
|
wiki_username: null,
|
||||||
profileHash: null,
|
profileHash: null,
|
||||||
kredits: null,
|
balance: null,
|
||||||
isCore: false,
|
isCore: false,
|
||||||
isCurrentUser: false,
|
isCurrentUser: false,
|
||||||
|
|
||||||
|
|||||||
@@ -18,16 +18,16 @@ let addFixtures = function(controller) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
[
|
[
|
||||||
{ github_username: "neo", github_uid: "318", kredits: 10000 },
|
{ github_username: "neo", github_uid: "318", balance: 10000 },
|
||||||
{ github_username: "morpheus", github_uid: "843", kredits: 15000 },
|
{ github_username: "morpheus", github_uid: "843", balance: 15000 },
|
||||||
{ github_username: "trinity", github_uid: "123", kredits: 5000 },
|
{ github_username: "trinity", github_uid: "123", balance: 5000 },
|
||||||
{ github_username: "mouse", github_uid: "696", kredits: 0 }
|
{ github_username: "mouse", github_uid: "696", balance: 0 }
|
||||||
].forEach(fixture => {
|
].forEach(fixture => {
|
||||||
controller.get('model.contributors').push(Contributor.create(fixture));
|
controller.get('model.contributors').push(Contributor.create(fixture));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
test('doesn\'t contain people with 0 kredits', function(assert) {
|
test('doesn\'t contain people with 0 balance', function(assert) {
|
||||||
let controller = this.subject();
|
let controller = this.subject();
|
||||||
addFixtures(controller);
|
addFixtures(controller);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user