Implement batch voting
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user