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:
authordartcafe <github@dartcafe.de>2021-05-19 22:31:33 +0300
committerdartcafe <github@dartcafe.de>2021-05-19 22:31:33 +0300
commitaee209e115cf8e2a9aff20bd620f749d322d4ecd (patch)
tree11d37c730700cbfcd59bf44d64a55f2c8c0d7e67 /src/js/components/Configuration
parent23e365f39dde884866d810f86c058bc00e4d6223 (diff)
Option to hadle no as unvoted
Signed-off-by: dartcafe <github@dartcafe.de>
Diffstat (limited to 'src/js/components/Configuration')
-rw-r--r--src/js/components/Configuration/ConfigUseNo.vue61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/js/components/Configuration/ConfigUseNo.vue b/src/js/components/Configuration/ConfigUseNo.vue
new file mode 100644
index 00000000..3cfee72f
--- /dev/null
+++ b/src/js/components/Configuration/ConfigUseNo.vue
@@ -0,0 +1,61 @@
+<!--
+ - @copyright Copyright (c) 2021 René Gieling <github@dartcafe.de>
+ -
+ - @author René Gieling <github@dartcafe.de>
+ -
+ - @license GNU AGPL version 3 or any later version
+ -
+ - This program is free software: you can redistribute it and/or modify
+ - it under the terms of the GNU Affero General Public License as
+ - published by the Free Software Foundation, either version 3 of the
+ - License, or (at your option) any later version.
+ -
+ - This program is distributed in the hope that it will be useful,
+ - but WITHOUT ANY WARRANTY; without even the implied warranty of
+ - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ - GNU Affero General Public License for more details.
+ -
+ - You should have received a copy of the GNU Affero General Public License
+ - along with this program. If not, see <http://www.gnu.org/licenses/>.
+ -
+ -->
+
+<template>
+ <CheckBoxDiv v-model="useNo" :label="label" />
+</template>
+
+<script>
+import { mapState } from 'vuex'
+import CheckBoxDiv from '../Base/CheckBoxDiv'
+
+export default {
+ name: 'ConfigUseNo',
+
+ components: {
+ CheckBoxDiv,
+ },
+
+ data() {
+ return {
+ label: t('polls', 'Delete vote when switched to "no"'),
+ }
+ },
+
+ computed: {
+ ...mapState({
+ poll: (state) => state.poll,
+ }),
+
+ useNo: {
+ get() {
+ return !this.poll.useNo
+ },
+ set(value) {
+ this.$store.commit('poll/setProperty', { useNo: +(!value) })
+ this.$emit('change')
+ },
+ },
+
+ },
+}
+</script>