WIP: add quick filter buttons

This commit is contained in:
2019-06-28 16:50:20 +02:00
parent 29a6d79d38
commit 0e0b1afe3a
3 changed files with 30 additions and 1 deletions
+11
View File
@@ -25,6 +25,9 @@ export default Controller.extend({
showUnconfirmedKredits: true, showUnconfirmedKredits: true,
hideUnconfirmedKredits: not('showUnconfirmedKredits'), hideUnconfirmedKredits: not('showUnconfirmedKredits'),
showQuickFilterUnconfirmed: false,
showQuickFilterConfirmed: false,
actions: { actions: {
vetoContribution (contributionId) { vetoContribution (contributionId) {
@@ -37,6 +40,14 @@ export default Controller.extend({
this.kredits.vote(proposalId).then(transaction => { this.kredits.vote(proposalId).then(transaction => {
console.debug('[controllers:index] Vote submitted to Ethereum blockhain: '+transaction.hash); console.debug('[controllers:index] Vote submitted to Ethereum blockhain: '+transaction.hash);
}); });
},
toggleQuickFilterUnconfirmed () {
this.toggleProperty('showQuickFilterUnconfirmed');
},
toggleQuickFilterConfirmed () {
this.toggleProperty('showQuickFilterConfirmed');
} }
} }
+14
View File
@@ -11,10 +11,18 @@ button, input[type=submit], .button {
cursor: pointer; cursor: pointer;
letter-spacing: 0.1em; letter-spacing: 0.1em;
&+button, &+input[type=submit], &+.button {
margin-left: 0.5rem;
}
&:hover { &:hover {
background-color: rgba(22, 21, 40, 0.8); background-color: rgba(22, 21, 40, 0.8);
} }
&:active, &.active {
border-color: $primary-color;
}
&.small { &.small {
font-size: 0.8rem; font-size: 0.8rem;
padding: 0.2rem 0.8rem; padding: 0.2rem 0.8rem;
@@ -28,6 +36,9 @@ button, input[type=submit], .button {
&:hover { &:hover {
background-color: rgba(40, 21, 21, 0.8); background-color: rgba(40, 21, 21, 0.8);
} }
&:active, &.active {
border-color: $red;
}
} }
&.green { &.green {
@@ -38,5 +49,8 @@ button, input[type=submit], .button {
&:hover { &:hover {
background-color: rgba(21, 40, 21, 0.8); background-color: rgba(21, 40, 21, 0.8);
} }
&:active, &.active {
border-color: $green;
}
} }
} }
+5 -1
View File
@@ -42,6 +42,7 @@
<h2>Latest Contributions</h2> <h2>Latest Contributions</h2>
{{#if kredits.hasAccounts}} {{#if kredits.hasAccounts}}
<nav> <nav>
<button {{action "toggleQuickFilterUnconfirmed"}} class="small {{if showQuickFilterUnconfirmed "active"}}">filter</button>
{{link-to "add" "contributions.new" title="Submit a contribution" class="button small green"}} {{link-to "add" "contributions.new" title="Submit a contribution" class="button small green"}}
</nav> </nav>
{{/if}} {{/if}}
@@ -56,8 +57,11 @@
{{/if}} {{/if}}
<section id="contributions-confirmed"> <section id="contributions-confirmed">
<header> <header class="with-nav">
<h2>Confirmed Contributions</h2> <h2>Confirmed Contributions</h2>
<nav>
<button {{action "toggleQuickFilterConfirmed"}} class="small {{if showQuickFilterConfirmed "active"}}">filter</button>
</nav>
</header> </header>
<div class="content"> <div class="content">
{{contribution-list contributions=contributionsConfirmedSorted {{contribution-list contributions=contributionsConfirmedSorted