Implement batch voting

This commit is contained in:
2018-04-24 15:29:10 +02:00
committed by Sebastian Kippe
parent 1945074db6
commit cb4d20cf81
6 changed files with 60 additions and 34 deletions
+9 -4
View File
@@ -20,10 +20,15 @@ export default Controller.extend({
proposalsOpenSorted: sort('proposalsOpen', 'proposalsSorting'),
actions: {
confirmProposal(proposalId) {
this.kredits.vote(proposalId).then(transaction => {
window.confirm('Vote submitted to Ethereum blockhain: '+transaction.hash);
});
confirmProposals(proposalIds) {
if (this.kredits.currentUser.isCore) {
this.kredits.batchVote(proposalIds)
.then((transaction) => {
window.confirm('Vote submitted to Ethereum blockhain: '+transaction.hash);
});
} else {
window.alert('Only members can vote on proposals. Please ask someone to set you up.');
}
},
save(contributor) {