Add metadata row to contributor list

Contains links to Ethereum address and IPFS content.
This commit is contained in:
2017-02-19 10:30:56 +08:00
parent e7fa188797
commit 0a2f44cec8
3 changed files with 71 additions and 8 deletions
@@ -10,5 +10,17 @@
<span class="symbol">₭S</span> <span class="symbol">₭S</span>
</td> </td>
</tr> </tr>
<tr class="metadata visible {{if contributor.isCurrentUser 'current-user'}}">
<td colspan="2">
<dl>
<dt>Ethereum address</dt>
<dd><a href="https://testnet.etherscan.io/address/{{contributor.address}}">{{contributor.address}}</a></dd>
{{#if contributor.ipfsHash}}
<dt>IPFS profile data</dt>
<dd><a href="https://ipfs.io/ipfs/{{contributor.ipfsHash}}">{{contributor.ipfsHash}}</a></dd>
{{/if}}
</dl>
</td>
</tr>
{{/each}} {{/each}}
</tbody> </tbody>
+2 -1
View File
@@ -65,11 +65,12 @@ export default Ember.Service.extend({
this.getValueFromContract('contributorAddresses', i).then(address => { this.getValueFromContract('contributorAddresses', i).then(address => {
this.getValueFromContract('contributors', address).then(person => { this.getValueFromContract('contributors', address).then(person => {
this.getValueFromContract('balanceOf', address).then(balance => { this.getValueFromContract('balanceOf', address).then(balance => {
console.debug('person', person);
let contributor = Contributor.create({ let contributor = Contributor.create({
address: address, address: address,
github_username: person[1], github_username: person[1],
github_uid: person[0], github_uid: person[0],
ipfsHash: person[3], ipfsHash: person[2],
kredits: balance.toNumber(), kredits: balance.toNumber(),
isCurrentUser: this.get('currentUserAccounts').includes(address) isCurrentUser: this.get('currentUserAccounts').includes(address)
}); });
+57 -7
View File
@@ -7,12 +7,68 @@ table.contributor-list {
&:first-of-type { &:first-of-type {
border-top: 1px solid rgba(255,255,255,0.2); border-top: 1px solid rgba(255,255,255,0.2);
} }
background-color: rgba(255,255,255,0.1);
&.current-user {
background-color: rgba(255,255,255,0.2);
}
&.metadata {
height: 0;
td {
padding: 0 1.2rem;
transition: all 0.2s ease-out;
}
a {
color: lightblue;
&:hover, &:active {
color: #fff;
}
}
dl {
display: block;
width: 100%;
font-size: 1rem;
dt, dd {
display: inline-block;
overflow: hidden;
height: 0;
line-height: 1.6rem;
transition: all 0.2s ease-out;
}
dt {
clear: both;
float: left;
width: 30%;
}
dd {
float: right;
width: 70%;
text-align: right;
}
}
&.visible {
td {
padding: 1rem 1.2rem;
}
dl {
dt, dd {
height: auto;
}
}
}
}
td { td {
padding: 0 1.2rem; padding: 0 1.2rem;
line-height: 4.2rem; line-height: 4.2rem;
background-color: rgba(255,255,255,0.1);
&.person { &.person {
text-align: left; text-align: left;
font-size: 1.4rem; font-size: 1.4rem;
@@ -36,11 +92,5 @@ table.contributor-list {
} }
} }
} }
&.current-user {
td {
background-color: rgba(255,255,255,0.2);
}
}
} }
} }