Fix contributor details view in toplist
This commit is contained in:
@@ -9,10 +9,10 @@ export default Component.extend({
|
|||||||
actions: {
|
actions: {
|
||||||
|
|
||||||
toggleContributorInfo(contributor) {
|
toggleContributorInfo(contributor) {
|
||||||
if (contributor.get('showMetadata')) {
|
if (contributor.showMetadata) {
|
||||||
contributor.set('showMetadata', false);
|
contributor.set('showMetadata', false);
|
||||||
} else {
|
} else {
|
||||||
this.contributors.setEach('showMetadata', false);
|
this.contributorList.setEach('showMetadata', false);
|
||||||
contributor.set('showMetadata', true);
|
contributor.set('showMetadata', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{{#each contributorList as |c|}}
|
{{#each contributorList as |c|}}
|
||||||
<tr role="button" class={{if (is-current-user c.contributor) "current-user"}} {{action "toggleContributorInfo" c.contributor}}>
|
<tr role="button" class={{if (is-current-user c.contributor) "current-user"}} {{action "toggleContributorInfo" c}}>
|
||||||
<td class="person">
|
<td class="person">
|
||||||
{{user-avatar contributor=c.contributor}} {{c.contributor.name}}
|
{{user-avatar contributor=c.contributor}} {{c.contributor.name}}
|
||||||
</td>
|
</td>
|
||||||
@@ -18,12 +18,16 @@
|
|||||||
<tr class="metadata {{if (is-current-user c.contributor) "current-user"}} {{if c.showMetadata "visible"}}">
|
<tr class="metadata {{if (is-current-user c.contributor) "current-user"}} {{if c.showMetadata "visible"}}">
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://testnet.etherscan.io/address/{{c.contributor.account}}">Inspect Ethereum transactions</a></li>
|
<li>
|
||||||
|
<a href="https://testnet.etherscan.io/address/{{c.contributor.account}}" target="_blank" rel="noopener">Inspect Ethereum transactions</a>
|
||||||
|
</li>
|
||||||
{{#if c.contributor.ipfsHash}}
|
{{#if c.contributor.ipfsHash}}
|
||||||
<li><a href="https://ipfs.io/ipfs/{{c.contributor.ipfsHash}}">Inspect IPFS profile</a></li>
|
<li>
|
||||||
|
<a href="https://ipfs.io/ipfs/{{c.contributor.ipfsHash}}" target="_blank" rel="noopener">Inspect IPFS profile</a>
|
||||||
|
</li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</ul>
|
</ul>
|
||||||
{{#if c.contributor.showMetadata}}
|
{{#if c.showMetadata}}
|
||||||
<pre>{{c.contributor.ipfsData}}</pre>
|
<pre>{{c.contributor.ipfsData}}</pre>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import Kredits from 'npm:kredits-contracts';
|
|||||||
import RSVP from 'rsvp';
|
import RSVP from 'rsvp';
|
||||||
|
|
||||||
import Service from '@ember/service';
|
import Service from '@ember/service';
|
||||||
|
import EmberObject from '@ember/object';
|
||||||
import { computed } from '@ember/object';
|
import { computed } from '@ember/object';
|
||||||
import { alias, notEmpty } from '@ember/object/computed';
|
import { alias, notEmpty } from '@ember/object/computed';
|
||||||
import { isEmpty } from '@ember/utils';
|
import { isEmpty } from '@ember/utils';
|
||||||
@@ -50,12 +51,12 @@ export default Service.extend({
|
|||||||
return contributionsGrouped.map(c => {
|
return contributionsGrouped.map(c => {
|
||||||
const amountUnconfirmed = c.items.mapBy('amount').reduce((a, b) => a + b);
|
const amountUnconfirmed = c.items.mapBy('amount').reduce((a, b) => a + b);
|
||||||
const contributor = this.contributors.findBy('id', c.value.toString());
|
const contributor = this.contributors.findBy('id', c.value.toString());
|
||||||
return {
|
return EmberObject.create({
|
||||||
contributor: contributor,
|
contributor: contributor,
|
||||||
amountUnconfirmed: amountUnconfirmed,
|
amountUnconfirmed: amountUnconfirmed,
|
||||||
amountConfirmed: contributor.totalKreditsEarned,
|
amountConfirmed: contributor.totalKreditsEarned,
|
||||||
amountTotal: contributor.totalKreditsEarned + amountUnconfirmed
|
amountTotal: contributor.totalKreditsEarned + amountUnconfirmed
|
||||||
}
|
})
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user