Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8c759601ca | |||
| 15e5d3c2fb | |||
| 47b7a6501b | |||
| 42304a8e27 | |||
| 9a4db6daf6 | |||
| 26dc78f553 | |||
| 5a618f7ef9 | |||
| 5d29bd9604 | |||
| 97cc71024f | |||
| 58f1382df1 | |||
| 6c5406c0b9 |
@@ -8,7 +8,7 @@
|
||||
<span class="core-flag">(core)</span>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
Anonymous
|
||||
<span class="anonymous">Anonymous</span>
|
||||
<button {{action "signup"}} class="small">Sign up</button>
|
||||
{{#if showConnectButton}}
|
||||
<button {{action "connectAccount"}} class="small green">Connect account</button>
|
||||
|
||||
@@ -33,6 +33,10 @@ export default Controller.extend({
|
||||
showQuickFilterUnconfirmed: false,
|
||||
showQuickFilterConfirmed: false,
|
||||
|
||||
showIntroText: computed('kredits.{hasAccounts,currentUser}', function(){
|
||||
return (!this.kredits.hasAccounts || !this.kredits.currentUser);
|
||||
}),
|
||||
|
||||
actions: {
|
||||
|
||||
vetoContribution (contributionId) {
|
||||
|
||||
@@ -25,8 +25,6 @@ export default Helper.extend({
|
||||
status.push('pending');
|
||||
}
|
||||
|
||||
status.push('pending');
|
||||
|
||||
return status.join(' ');
|
||||
},
|
||||
|
||||
|
||||
@@ -8,8 +8,3 @@ $red: #fb6868;
|
||||
$primary-color: $blue;
|
||||
|
||||
$body-text-color: #fff;
|
||||
|
||||
#topbar {
|
||||
background-color: rgba(255, 0, 255, .2);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,40 @@ main {
|
||||
}
|
||||
}
|
||||
|
||||
#intro {
|
||||
padding: 2rem;
|
||||
background-color: rgba(0,0,0,.2);
|
||||
font-size: 1.6rem;
|
||||
|
||||
@include media-max(small) {
|
||||
padding: 2rem 1rem;
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: inherit;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 1em;
|
||||
line-height: 1.5em;
|
||||
font-size: 1.2rem;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
|
||||
&:hover, &:active {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 550px) {
|
||||
main {
|
||||
&#dashboard {
|
||||
|
||||
@@ -8,4 +8,10 @@ header#topbar section#user-account {
|
||||
margin-left: 0.6rem;
|
||||
}
|
||||
|
||||
@include media-max(small) {
|
||||
.anonymous {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
{{#if showIntroText}}
|
||||
<div id="intro">
|
||||
<h2>
|
||||
Welcome to the contribution dashboard of the
|
||||
<a href="https://kosmos.org" target="_blank" rel="noopener">Kosmos</a> project!
|
||||
</h2>
|
||||
<p>
|
||||
If you want to learn more about what the numbers mean and how this works,
|
||||
check out the
|
||||
<a href="https://wiki.kosmos.org/Kredits" target="_blank" rel="noopener">Kredits documentation</a>.
|
||||
If you want to start earning kredits for your contributions,
|
||||
{{link-to "create a contributor profile" "signup"}}.
|
||||
</p>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<main id="dashboard" class={{if showDetailsPane "with-details"}}>
|
||||
|
||||
<div id="stats">
|
||||
@@ -41,12 +57,12 @@
|
||||
<section id="contributions-unconfirmed">
|
||||
<header class="with-nav">
|
||||
<h2>Latest Contributions</h2>
|
||||
{{#if kredits.hasAccounts}}
|
||||
<nav>
|
||||
<button {{action "toggleQuickFilterUnconfirmed"}} class="small {{if showQuickFilterUnconfirmed "active"}}">filter</button>
|
||||
<nav>
|
||||
<button {{action "toggleQuickFilterUnconfirmed"}} class="small {{if showQuickFilterUnconfirmed "active"}}">filter</button>
|
||||
{{#if kredits.hasAccounts}}
|
||||
{{link-to "add" "contributions.new" title="Submit a contribution" class="button small green"}}
|
||||
</nav>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</nav>
|
||||
</header>
|
||||
<div class="content">
|
||||
{{!-- TODO: We need a better naming for kredits.hasAccounts --}}
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
|
||||
<div class="actions">
|
||||
<p>
|
||||
{{link-to "Copy & edit as new" "contributions.resubmit" model class="button small"}}.
|
||||
{{#if model.ipfsHash}}
|
||||
<a href="{{ipfsGatewayUrl}}/{{model.ipfsHash}}"
|
||||
class="button small" target="_blank" rel="noopener">
|
||||
|
||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "kredits-web",
|
||||
"version": "1.11.0",
|
||||
"version": "1.13.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "kredits-web",
|
||||
"version": "1.11.0",
|
||||
"version": "1.13.0",
|
||||
"private": true,
|
||||
"description": "Contribution dashboard of the Kosmos project",
|
||||
"repository": "https://github.com/67P/kredits-web",
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+7
-7
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3
-3
@@ -8,10 +8,10 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
|
||||
|
||||
<meta name="kredits-web/config/environment" content="%7B%22modulePrefix%22%3A%22kredits-web%22%2C%22environment%22%3A%22production%22%2C%22rootURL%22%3A%22%2F%22%2C%22locationType%22%3A%22auto%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%2C%22EXTEND_PROTOTYPES%22%3A%7B%22Date%22%3Afalse%7D%2C%22_JQUERY_INTEGRATION%22%3Atrue%7D%2C%22APP%22%3A%7B%22name%22%3A%22kredits-web%22%2C%22version%22%3A%221.11.0%2B134eb7d3%22%7D%2C%22browserify%22%3A%7B%22tests%22%3Atrue%2C%22transform%22%3A%5B%5B%22babelify%22%2C%7B%22presets%22%3A%5B%22es2015%22%5D%2C%22global%22%3Atrue%7D%5D%5D%7D%2C%22web3ProviderUrl%22%3A%22https%3A%2F%2Frinkeby.infura.io%2Fv3%2Fd4f788b7a6584f7db2fc3c268d4d09e9%22%2C%22web3RequiredNetwork%22%3A%22rinkeby%22%2C%22githubConnectUrl%22%3A%22https%3A%2F%2Fhal8000.chat.kosmos.org%2Fkredits%2Fsignup%2Fconnect%2Fgithub%22%2C%22githubSignupUrl%22%3A%22https%3A%2F%2Fhal8000.chat.kosmos.org%2Fkredits%2Fsignup%2Fgithub%22%2C%22ipfs%22%3A%7B%22host%22%3A%22ipfs.kosmos.org%22%2C%22port%22%3A%225444%22%2C%22protocol%22%3A%22https%22%2C%22gatewayUrl%22%3A%22https%3A%2F%2Fipfs.kosmos.org%2Fipfs%22%7D%2C%22exportApplicationGlobal%22%3Afalse%7D" />
|
||||
<meta name="kredits-web/config/environment" content="%7B%22modulePrefix%22%3A%22kredits-web%22%2C%22environment%22%3A%22production%22%2C%22rootURL%22%3A%22%2F%22%2C%22locationType%22%3A%22auto%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%2C%22EXTEND_PROTOTYPES%22%3A%7B%22Date%22%3Afalse%7D%2C%22_JQUERY_INTEGRATION%22%3Atrue%7D%2C%22APP%22%3A%7B%22name%22%3A%22kredits-web%22%2C%22version%22%3A%221.13.0%2B15e5d3c2%22%7D%2C%22browserify%22%3A%7B%22tests%22%3Atrue%2C%22transform%22%3A%5B%5B%22babelify%22%2C%7B%22presets%22%3A%5B%22es2015%22%5D%2C%22global%22%3Atrue%7D%5D%5D%7D%2C%22web3ProviderUrl%22%3A%22https%3A%2F%2Frinkeby.infura.io%2Fv3%2Fd4f788b7a6584f7db2fc3c268d4d09e9%22%2C%22web3RequiredNetwork%22%3A%22rinkeby%22%2C%22githubConnectUrl%22%3A%22https%3A%2F%2Fhal8000.chat.kosmos.org%2Fkredits%2Fsignup%2Fconnect%2Fgithub%22%2C%22githubSignupUrl%22%3A%22https%3A%2F%2Fhal8000.chat.kosmos.org%2Fkredits%2Fsignup%2Fgithub%22%2C%22ipfs%22%3A%7B%22host%22%3A%22ipfs.kosmos.org%22%2C%22port%22%3A%225444%22%2C%22protocol%22%3A%22https%22%2C%22gatewayUrl%22%3A%22https%3A%2F%2Fipfs.kosmos.org%2Fipfs%22%7D%2C%22exportApplicationGlobal%22%3Afalse%7D" />
|
||||
|
||||
<link integrity="" rel="stylesheet" href="/assets/vendor-179cf27a97ea5bbb0ce72403a401cc8c.css">
|
||||
<link integrity="" rel="stylesheet" href="/assets/kredits-web-a1a46af359f6abc5253690f6a7b29c6b.css">
|
||||
<link integrity="" rel="stylesheet" href="/assets/kredits-web-7486572f1c1005f28df459da134a97f2.css">
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
|
||||
<script src="/assets/vendor-21c31ba5343c7b72f638899d335a0531.js" integrity="sha256-5QKR4/TvbS9UoThtAlcyvj54wU+Bcn0hnM0FzjUbvfA= sha512-tHxWM5t9FYFz6DBnXuzWiIMPPW/gNwPaFDOdUL32cWvWcMfjyrhIEPM5I1D6+HQE1kXCEd64a+7UiMdU2hH5JQ==" ></script>
|
||||
<script src="/assets/kredits-web-13518de1c34085ebbf2581fb0036f391.js" integrity="sha256-yC9tbe9taJYd3j94+70S//WPlNWBLf9mUX2No5+QCFQ= sha512-aZA6zfTNdllU23J2P/utN93NpEcSa627Qh+HiLYEuOXL1nqsMPn2okMqx8GCEruOjxzWP3g0NhyGE7MTE8IJDg==" ></script>
|
||||
<script src="/assets/kredits-web-a6b23d76eb470475515cfa602440fbfb.js" integrity="sha256-0kjKqEi3xMDzRlsV7Z+2x9xXF5AAi0EFVSLPD16NdH8= sha512-9IuLwhzOfgxZKJZ2L2sy4zoibavROIwKU4TRoNYGdzkVqPUhNOhT5i3BLgbRrZ57oFm5WwfjVyB6RAoVjVz06w==" ></script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
import Contribution from 'kredits-web/models/contribution';
|
||||
|
||||
module('Unit | Helper | contribution-status', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('returns the appropriate status', function (assert) {
|
||||
const contributionStatus = this.owner.factoryFor('helper:contribution-status').create();
|
||||
const kredits = this.owner.lookup('service:kredits');
|
||||
|
||||
kredits.set('currentBlock', 23000);
|
||||
|
||||
const contributionUnconfirmed = Contribution.create({ confirmedAt: 23001, vetoed: false });
|
||||
const contributionConfirmed = Contribution.create({ confirmedAt: 21000, vetoed: false });
|
||||
const contributionVetoed = Contribution.create({ confirmedAt: 23001, vetoed: true });
|
||||
|
||||
assert.equal(contributionStatus.compute([contributionUnconfirmed]), 'unconfirmed');
|
||||
assert.equal(contributionStatus.compute([contributionConfirmed]), 'confirmed');
|
||||
assert.equal(contributionStatus.compute([contributionVetoed]), 'vetoed');
|
||||
});
|
||||
});
|
||||
@@ -1,21 +0,0 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Helper | contribution-status', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('returns the appropriate status', function (assert) {
|
||||
const contributionStatus = this.owner.factoryFor('helper:contribution-status').create();
|
||||
const kredits = this.owner.lookup('service:kredits');
|
||||
|
||||
kredits.set('currentBlock', 23000);
|
||||
|
||||
const contributionUnconfirmed = { confirmedAt: 23001, vetoed: false };
|
||||
const contributionConfirmed = { confirmedAt: 21000, vetoed: false };
|
||||
const contributionVetoed = { confirmedAt: 23001, vetoed: true };
|
||||
|
||||
assert.eq(contributionStatus.compute([contributionUnconfirmed]), 'unconfirmed');
|
||||
assert.eq(contributionStatus.compute([contributionConfirmed]), 'confirmed');
|
||||
assert.eq(contributionStatus.compute([contributionVetoed]), 'vetoed');
|
||||
});
|
||||
});
|
||||
@@ -1,21 +0,0 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Helper | contribution-status', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('returns the appropriate status', function (assert) {
|
||||
const contributionStatus = this.owner.factoryFor('helper:contribution-status').create();
|
||||
const kredits = this.owner.lookup('service:kredits');
|
||||
|
||||
kredits.set('currentBlock', 23000);
|
||||
|
||||
const contributionUnconfirmed = { confirmedAt: 23001, vetoed: false };
|
||||
const contributionConfirmed = { confirmedAt: 21000, vetoed: false };
|
||||
const contributionVetoed = { confirmedAt: 23001, vetoed: true };
|
||||
|
||||
assert.notOk(contributionStatus.compute([contributionUnconfirmed]), 'unconfirmed');
|
||||
assert.notOk(contributionStatus.compute([contributionVetoed]), 'vetoed');
|
||||
assert.ok(contributionStatus.compute([contributionConfirmed]), 'confirmed');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user