client: link to update vote count
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/test Pipeline failed
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/test Pipeline failed
This commit is contained in:
parent
24f6177b94
commit
86565cd25b
|
@ -13,6 +13,8 @@
|
||||||
<p v-if="!readOnly">
|
<p v-if="!readOnly">
|
||||||
<span>{{ i18n.t('_poll.totalVotes', { n: total }) }}</span>
|
<span>{{ i18n.t('_poll.totalVotes', { n: total }) }}</span>
|
||||||
<span> · </span>
|
<span> · </span>
|
||||||
|
<a @click="update()">{{ i18n.ts.reload }}</a>
|
||||||
|
<span> · </span>
|
||||||
<a v-if="!closed && !isVoted" @click="showResult = !showResult">{{ showResult ? i18n.ts._poll.vote : i18n.ts._poll.showResult }}</a>
|
<a v-if="!closed && !isVoted" @click="showResult = !showResult">{{ showResult ? i18n.ts._poll.vote : i18n.ts._poll.showResult }}</a>
|
||||||
<span v-if="isVoted">{{ i18n.ts._poll.voted }}</span>
|
<span v-if="isVoted">{{ i18n.ts._poll.voted }}</span>
|
||||||
<span v-else-if="closed">{{ i18n.ts._poll.closed }}</span>
|
<span v-else-if="closed">{{ i18n.ts._poll.closed }}</span>
|
||||||
|
@ -84,6 +86,14 @@ const vote = async (id) => {
|
||||||
});
|
});
|
||||||
if (!showResult.value) showResult.value = !props.note.poll.multiple;
|
if (!showResult.value) showResult.value = !props.note.poll.multiple;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const update = async () => {
|
||||||
|
pleaseLoginOrRemote(urlForNote(props.note));
|
||||||
|
|
||||||
|
await os.apiWithDialog('notes/polls/update', {
|
||||||
|
noteId: props.note.id,
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
Loading…
Reference in a new issue