diff options
author | René Gieling <github@dartcafe.de> | 2021-03-02 16:41:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-02 16:41:39 +0300 |
commit | 8bd5e69cb454e7315e4b8b3e20f415587356366e (patch) | |
tree | 445444dab8425aa8427bc4e6cf675ea241721351 /src/js/components/VoteTable | |
parent | 5e04fe191f047d88080db44c60b0b562d7b1f62a (diff) |
added hide options if booked out and move some logic to backend (#1449)
Diffstat (limited to 'src/js/components/VoteTable')
-rw-r--r-- | src/js/components/VoteTable/VoteItem.vue | 10 | ||||
-rw-r--r-- | src/js/components/VoteTable/VoteTable.vue | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/js/components/VoteTable/VoteItem.vue b/src/js/components/VoteTable/VoteItem.vue index fd95e02b..040183ea 100644 --- a/src/js/components/VoteTable/VoteItem.vue +++ b/src/js/components/VoteTable/VoteItem.vue @@ -60,7 +60,11 @@ export default { }), isVotable() { - return this.isActive && this.isValidUser && !this.pollIsClosed && !this.isLocked && !this.isBlocked + return this.isActive + && this.isValidUser + && !this.pollIsClosed + && !this.isLocked + && !this.option.isBookedUp }, isActive() { @@ -78,10 +82,6 @@ export default { }).voteAnswer }, - isBlocked() { - return this.optionLimit > 0 && this.optionLimit <= this.option.yes && this.answer !== 'yes' - }, - isLocked() { return (this.countYesVotes >= this.voteLimit && this.voteLimit > 0 && this.answer !== 'yes') }, diff --git a/src/js/components/VoteTable/VoteTable.vue b/src/js/components/VoteTable/VoteTable.vue index aeff9eb8..0aeb53cc 100644 --- a/src/js/components/VoteTable/VoteTable.vue +++ b/src/js/components/VoteTable/VoteTable.vue @@ -130,16 +130,16 @@ export default { acl: state => state.poll.acl, poll: state => state.poll, settings: state => state.settings.user, + options: state => state.options.list, }), ...mapGetters({ closed: 'poll/closed', participants: 'poll/participants', - sortedOptions: 'options/sorted', }), rankedOptions() { - return orderBy(this.sortedOptions, this.ranked ? 'rank' : 'order', 'asc') + return orderBy(this.options, this.ranked ? 'rank' : 'order', 'asc') }, }, |