Show unconfirmed kredits in toplist
And allow toggling between confirmed and unconfirmed
This commit is contained in:
@@ -1,24 +1,30 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{{#each contributors as |contributor|}}
|
{{#each contributorList as |c|}}
|
||||||
<tr role="button" class={{if (is-current-user contributor) "current-user"}} {{action "toggleContributorInfo" contributor}}>
|
<tr role="button" class={{if (is-current-user c.contributor) "current-user"}} {{action "toggleContributorInfo" c.contributor}}>
|
||||||
<td class="person">
|
<td class="person">
|
||||||
{{user-avatar contributor=contributor}} {{contributor.name}}
|
{{user-avatar contributor=c.contributor}} {{c.contributor.name}}
|
||||||
</td>
|
</td>
|
||||||
<td class="kredits">
|
<td class="kredits">
|
||||||
<span class="amount">{{contributor.totalKreditsEarned}}</span>
|
<span class="amount">
|
||||||
|
{{#if showUnconfirmedKredits}}
|
||||||
|
{{c.amountTotal}}
|
||||||
|
{{else}}
|
||||||
|
{{c.amountConfirmed}}
|
||||||
|
{{/if}}
|
||||||
|
</span>
|
||||||
<span class="symbol">₭S</span>
|
<span class="symbol">₭S</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="metadata {{if (is-current-user contributor) "current-user"}} {{if contributor.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/{{contributor.account}}">Inspect Ethereum transactions</a></li>
|
<li><a href="https://testnet.etherscan.io/address/{{c.contributor.account}}">Inspect Ethereum transactions</a></li>
|
||||||
{{#if contributor.ipfsHash}}
|
{{#if c.contributor.ipfsHash}}
|
||||||
<li><a href="https://ipfs.io/ipfs/{{contributor.ipfsHash}}">Inspect IPFS profile</a></li>
|
<li><a href="https://ipfs.io/ipfs/{{c.contributor.ipfsHash}}">Inspect IPFS profile</a></li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</ul>
|
</ul>
|
||||||
{{#if contributor.showMetadata}}
|
{{#if c.contributor.showMetadata}}
|
||||||
<pre>{{contributor.ipfsData}}</pre>
|
<pre>{{c.contributor.ipfsData}}</pre>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
+14
-10
@@ -1,25 +1,29 @@
|
|||||||
import Controller from '@ember/controller';
|
import Controller from '@ember/controller';
|
||||||
import { alias, filter, sort } from '@ember/object/computed';
|
import { computed } from '@ember/object';
|
||||||
|
import { alias, not, sort } from '@ember/object/computed';
|
||||||
import { inject as service } from '@ember/service';
|
import { inject as service } from '@ember/service';
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
kredits: service(),
|
kredits: service(),
|
||||||
currentBlock: alias('kredits.currentBlock'),
|
currentBlock: alias('kredits.currentBlock'),
|
||||||
|
|
||||||
contributors: alias('kredits.contributors'),
|
|
||||||
contributorsWithKredits: filter('contributors', function(contributor) {
|
|
||||||
return contributor.get('totalKreditsEarnedRaw').gt(0);
|
|
||||||
}),
|
|
||||||
contributorsSorting: Object.freeze(['totalKreditsEarned:desc']),
|
|
||||||
contributorsSorted: sort('contributorsWithKredits', 'contributorsSorting'),
|
|
||||||
|
|
||||||
contributions: alias('kredits.contributions'),
|
contributions: alias('kredits.contributions'),
|
||||||
contributionsUnconfirmed: alias('kredits.contributionsUnconfirmed'),
|
|
||||||
contributionsConfirmed: alias('kredits.contributionsConfirmed'),
|
contributionsConfirmed: alias('kredits.contributionsConfirmed'),
|
||||||
|
contributionsUnconfirmed: alias('kredits.contributionsUnconfirmed'),
|
||||||
|
|
||||||
|
contributionsSorting: Object.freeze(['id:desc']),
|
||||||
contributionsUnconfirmedSorted: sort('contributionsUnconfirmed', 'contributionsSorting'),
|
contributionsUnconfirmedSorted: sort('contributionsUnconfirmed', 'contributionsSorting'),
|
||||||
contributionsConfirmedSorted: sort('contributionsConfirmed', 'contributionsSorting'),
|
contributionsConfirmedSorted: sort('contributionsConfirmed', 'contributionsSorting'),
|
||||||
contributionsSorting: Object.freeze(['id:desc']),
|
|
||||||
|
kreditsByContributor: alias('kredits.kreditsByContributor'),
|
||||||
|
|
||||||
|
kreditsToplistSorting: computed('showUnconfirmedKredits', function(){
|
||||||
|
return this.showUnconfirmedKredits ? ['amountTotal:desc'] : ['amountConfirmed:desc'];
|
||||||
|
}),
|
||||||
|
kreditsToplist: sort('kreditsByContributor', 'kreditsToplistSorting'),
|
||||||
|
|
||||||
|
showUnconfirmedKredits: true,
|
||||||
|
hideUnconfirmedKredits: not('showUnconfirmedKredits'),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -47,7 +47,7 @@ section {
|
|||||||
&#people {
|
&#people {
|
||||||
.content {
|
.content {
|
||||||
p.stats {
|
p.stats {
|
||||||
padding-top: 3rem;
|
margin-bottom: 1rem;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
color: white;
|
color: white;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
table.contributor-list {
|
table.contributor-list {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
|
||||||
tr {
|
tr {
|
||||||
border-bottom: 1px solid rgba(255,255,255,0.2);
|
border-bottom: 1px solid rgba(255,255,255,0.2);
|
||||||
|
|||||||
@@ -6,12 +6,17 @@
|
|||||||
<h2>Contributors</h2>
|
<h2>Contributors</h2>
|
||||||
</header>
|
</header>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
{{contributor-list contributors=contributorsSorted}}
|
{{contributor-list contributorList=kreditsToplist
|
||||||
|
showUnconfirmedKredits=showUnconfirmedKredits}}
|
||||||
|
|
||||||
<p class="stats">
|
<p class="stats">
|
||||||
<span class="number">{{await kredits.totalKreditsEarned}}</span> kredits issued and distributed among
|
<span class="number">{{await kredits.totalKreditsEarned}}</span> kredits confirmed and issued to
|
||||||
<span class="number">{{contributorsWithKredits.length}}</span> contributors.
|
<span class="number">{{contributorsWithKredits.length}}</span> contributors.
|
||||||
</p>
|
</p>
|
||||||
|
<p class="stats">
|
||||||
|
{{input type="checkbox" id="hide-unnconfirmed-kredits" checked=showUnconfirmedKredits}}
|
||||||
|
<label for="hide-unnconfirmed-kredits">Show unconfirmed kredits in toplist</label>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user