Mark contributor in list as selected when opening details #137
@@ -7,7 +7,7 @@ export default Component.extend({
|
|||||||
|
|
||||||
tagName: 'table',
|
tagName: 'table',
|
||||||
classNames: 'contributor-list',
|
classNames: 'contributor-list',
|
||||||
selectedContributor: null,
|
selectedContributorId: null,
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{{#each contributorList as |c|}}
|
{{#each contributorList as |c|}}
|
||||||
<tr role="button" class={{if (is-current-user c.contributor) "current-user"}} {{action "openContributorDetails" c.contributor}}>
|
<tr role="button"
|
||||||
|
class="{{if (is-current-user c.contributor) "current-user"}} {{if (eq c.contributor.id selectedContributorId) "selected"}}"
|
||||||
|
{{action "openContributorDetails" c.contributor}}>
|
||||||
<td class="person">
|
<td class="person">
|
||||||
{{user-avatar contributor=c.contributor}} {{c.contributor.name}}
|
{{user-avatar contributor=c.contributor}} {{c.contributor.name}}
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export default Controller.extend({
|
|||||||
kredits: service(),
|
kredits: service(),
|
||||||
|
|
||||||
showDetailsPane: false,
|
showDetailsPane: false,
|
||||||
|
selectedContributorId: null,
|
||||||
|
|
||||||
currentBlock: alias('kredits.currentBlock'),
|
currentBlock: alias('kredits.currentBlock'),
|
||||||
|
|
||||||
|
|||||||
@@ -11,14 +11,22 @@ export default Route.extend({
|
|||||||
return this.contributors.findBy('id', params.id);
|
return this.contributors.findBy('id', params.id);
|
||||||
},
|
},
|
||||||
|
|
||||||
activate () {
|
setupController (controller, model) {
|
||||||
|
this._super(controller, model);
|
||||||
|
|
||||||
this.controllerFor('dashboard')
|
this.controllerFor('dashboard')
|
||||||
.set('showDetailsPane', true);
|
.setProperties({
|
||||||
|
showDetailsPane: true,
|
||||||
|
selectedContributorId: model.id
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
deactivate () {
|
deactivate () {
|
||||||
this.controllerFor('dashboard')
|
this.controllerFor('dashboard')
|
||||||
.set('showDetailsPane', false);
|
.setProperties({
|
||||||
|
showDetailsPane: false,
|
||||||
|
selectedContributorId: null
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,56 +4,20 @@ table.contributor-list {
|
|||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
|
|
||||||
tr {
|
tr {
|
||||||
|
background-color: rgba(255,255,255,0.1);
|
||||||
border-bottom: 1px solid rgba(255,255,255,0.2);
|
border-bottom: 1px solid rgba(255,255,255,0.2);
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
&: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 {
|
&.selected {
|
||||||
background-color: rgba(255,255,255,0.2);
|
background-color: rgba(255,255,255,0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.metadata {
|
&.current-user {
|
||||||
height: 0;
|
font-weight: 500;
|
||||||
visibility: hidden;
|
|
||||||
|
|
||||||
&:not(.visible) {
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
td {
|
|
||||||
padding: 0 1.2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: $primary-color;
|
|
||||||
&:hover, &:active {
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ul {
|
|
||||||
list-style: none;
|
|
||||||
display: block;
|
|
||||||
overflow: hidden;
|
|
||||||
height: 0;
|
|
||||||
|
|
||||||
li {
|
|
||||||
display: inline;
|
|
||||||
&+li {
|
|
||||||
margin-left: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.visible {
|
|
||||||
height: auto;
|
|
||||||
visibility: visible;
|
|
||||||
ul {
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
td {
|
td {
|
||||||
@@ -71,20 +35,17 @@ table.contributor-list {
|
|||||||
|
|
||||||
&.kredits {
|
&.kredits {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
|
||||||
.amount {
|
.amount {
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.symbol {
|
.symbol {
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
padding-left: 0.2rem;
|
padding-left: 0.2rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pre {
|
|
||||||
line-height: 1rem;
|
|
||||||
padding-bottom: 1rem;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
</header>
|
</header>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
{{contributor-list contributorList=kreditsToplist
|
{{contributor-list contributorList=kreditsToplist
|
||||||
showUnconfirmedKredits=showUnconfirmedKredits}}
|
showUnconfirmedKredits=showUnconfirmedKredits
|
||||||
|
selectedContributorId=selectedContributorId}}
|
||||||
|
|
||||||
<p class="stats">
|
<p class="stats">
|
||||||
<span class="number">{{await kredits.totalKreditsEarned}}</span> kredits confirmed and issued to
|
<span class="number">{{await kredits.totalKreditsEarned}}</span> kredits confirmed and issued to
|
||||||
|
|||||||
Reference in New Issue
Block a user