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
+11 -8
View File
@@ -1,20 +1,23 @@
import Component from '@ember/component';
import { inject } from '@ember/service';
import { empty } from '@ember/object/computed';
export default Component.extend({
kredits: inject(),
tagName: 'ul',
classNames: ['proposal-list'],
selectedProposals: [],
submitButtonDisabled: empty('selectedProposals'),
actions: {
confirm(proposalId) {
if (this.contractInteractionEnabled) {
this.confirmProposal(proposalId);
toggleSelect(proposalId, selected) {
if (selected) {
this.selectedProposals.removeObject(proposalId);
} else {
window.alert('Only members can vote on proposals. Please ask someone to set you up.');
this.selectedProposals.addObject(proposalId);
}
}
},
}
});