diff options
author | dartcafe <github@dartcafe.de> | 2020-09-03 19:07:37 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2020-09-03 19:07:37 +0300 |
commit | 7cfa3ac5f2aa3559cd3856546da359cef8d6680d (patch) | |
tree | 384b2379495bd41f164dda12d78f1874604e382c /src | |
parent | c72e917f10ca25c691813e191ebec90b7da88d92 (diff) |
Adding option for important polls
Diffstat (limited to 'src')
-rw-r--r-- | src/js/components/SideBar/SideBarTabConfiguration.vue | 15 | ||||
-rw-r--r-- | src/js/store/modules/poll.js | 1 | ||||
-rw-r--r-- | src/js/store/modules/polls.js | 3 |
3 files changed, 18 insertions, 1 deletions
diff --git a/src/js/components/SideBar/SideBarTabConfiguration.vue b/src/js/components/SideBar/SideBarTabConfiguration.vue index aca08205..7cd7d766 100644 --- a/src/js/components/SideBar/SideBarTabConfiguration.vue +++ b/src/js/components/SideBar/SideBarTabConfiguration.vue @@ -72,6 +72,12 @@ type="radio" class="radio"> <label for="public">{{ t('polls', 'Visible to other users') }}</label> + + <input id="important" + v-model="pollImportant" + type="checkbox" + class="checkbox"> + <label for="important"> {{ t('polls', 'Relevant for all users') }}</label> </ConfigBox> <ConfigBox :title="t('polls', 'Result display')" icon-class="icon-screen"> @@ -210,6 +216,15 @@ export default { }, }, + pollImportant: { + get() { + return (this.poll.important > 0) + }, + set(value) { + this.writeValue({ important: value }) + }, + }, + pollAdminAccess: { get() { return (this.poll.adminAccess > 0) diff --git a/src/js/store/modules/poll.js b/src/js/store/modules/poll.js index 3a8b0f31..7ee4eec3 100644 --- a/src/js/store/modules/poll.js +++ b/src/js/store/modules/poll.js @@ -47,6 +47,7 @@ const defaultPoll = () => { voteLimit: 0, showResults: 'always', adminAccess: 0, + important: 0, } } diff --git a/src/js/store/modules/polls.js b/src/js/store/modules/polls.js index 719b6f26..232d7bf1 100644 --- a/src/js/store/modules/polls.js +++ b/src/js/store/modules/polls.js @@ -46,7 +46,8 @@ const getters = { return state.list.filter(poll => (poll.owner === getCurrentUser().uid && !poll.deleted)) } else if (filterId === 'relevant') { return state.list.filter(poll => (( - poll.userHasVoted + poll.important + || poll.userHasVoted || poll.isOwner || (poll.allowView && poll.access !== 'public') ) |