Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/components')
-rw-r--r--src/js/components/Base/Confirmation.vue1
-rw-r--r--src/js/components/Options/OptionsDate.vue3
-rw-r--r--src/js/components/Options/OptionsText.vue5
-rw-r--r--src/js/components/SideBar/SideBarTabConfiguration.vue13
-rw-r--r--src/js/components/VoteTable/VoteItem.vue10
-rw-r--r--src/js/components/VoteTable/VoteTable.vue4
6 files changed, 23 insertions, 13 deletions
diff --git a/src/js/components/Base/Confirmation.vue b/src/js/components/Base/Confirmation.vue
index 9feff19e..30091335 100644
--- a/src/js/components/Base/Confirmation.vue
+++ b/src/js/components/Base/Confirmation.vue
@@ -48,7 +48,6 @@ export default {
}),
...mapGetters({
- votesRank: 'votes/ranked',
participantsVoted: 'poll/participantsVoted',
closed: 'poll/closed',
confirmedOptions: 'options/confirmed',
diff --git a/src/js/components/Options/OptionsDate.vue b/src/js/components/Options/OptionsDate.vue
index d01f873f..483e3c10 100644
--- a/src/js/components/Options/OptionsDate.vue
+++ b/src/js/components/Options/OptionsDate.vue
@@ -24,7 +24,7 @@
<div>
<ConfigBox v-if="countOptions" :title="t('polls', 'Available Options')" icon-class="icon-calendar-000">
<transition-group is="ul">
- <OptionItem v-for="(option) in sortedOptions"
+ <OptionItem v-for="(option) in options"
:key="option.id"
:option="option"
:show-confirmed="true"
@@ -113,7 +113,6 @@ export default {
}),
...mapGetters({
- sortedOptions: 'options/sorted',
pollIsClosed: 'poll/closed',
countOptions: 'options/count',
}),
diff --git a/src/js/components/Options/OptionsText.vue b/src/js/components/Options/OptionsText.vue
index 04613a39..10c23726 100644
--- a/src/js/components/Options/OptionsText.vue
+++ b/src/js/components/Options/OptionsText.vue
@@ -89,19 +89,18 @@ export default {
computed: {
...mapState({
- options: state => state.options,
+ options: state => state.options.list,
acl: state => state.poll.acl,
}),
...mapGetters({
- sortedOptions: 'options/sorted',
PollIsClosed: 'poll/closed',
countOptions: 'options/count',
}),
sortOptions: {
get() {
- return this.sortedOptions
+ return this.options
},
set(value) {
this.$store.dispatch('options/reorder', value)
diff --git a/src/js/components/SideBar/SideBarTabConfiguration.vue b/src/js/components/SideBar/SideBarTabConfiguration.vue
index 0e42c21f..f19fe1f4 100644
--- a/src/js/components/SideBar/SideBarTabConfiguration.vue
+++ b/src/js/components/SideBar/SideBarTabConfiguration.vue
@@ -56,6 +56,10 @@
use-num-modifiers
@add="pollOptionLimit++"
@subtract="pollOptionLimit--" />
+ <CheckBoxDiv v-if="pollOptionLimit"
+ v-model="hideBookedUp"
+ class="indented"
+ :label="t('polls', 'Hide not availabe Options')" />
</ConfigBox>
<ConfigBox :title="t('polls', 'Poll closing status')" :icon-class="closed ? 'icon-polls-closed' : 'icon-polls-open'">
@@ -216,6 +220,15 @@ export default {
},
},
+ hideBookedUp: {
+ get() {
+ return (this.poll.hideBookedUp > 0)
+ },
+ set(value) {
+ this.writeValue({ hideBookedUp: +value })
+ },
+ },
+
pollShowResults: {
get() {
return this.poll.showResults
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')
},
},