summaryrefslogtreecommitdiff
path: root/src/client/app
diff options
context:
space:
mode:
authorAya Morisawa <AyaMorisawa4869@gmail.com>2018-12-27 19:58:57 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2018-12-27 19:58:57 +0900
commitba0560607414d1f7db06960d2e936e9b3fb2fa91 (patch)
tree39ffcd33e42afdbf5ddf4d3d11645169f28ea064 /src/client/app
parentUpdate @fortawesome/free-solid-svg-icons requirement from 5.6.1 to 5.6.3 (#3754) (diff)
downloadsharkey-ba0560607414d1f7db06960d2e936e9b3fb2fa91.tar.gz
sharkey-ba0560607414d1f7db06960d2e936e9b3fb2fa91.tar.bz2
sharkey-ba0560607414d1f7db06960d2e936e9b3fb2fa91.zip
Show on the CW button that there is a poll (#3769)
Diffstat (limited to 'src/client/app')
-rw-r--r--src/client/app/common/views/components/cw-button.vue17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/client/app/common/views/components/cw-button.vue b/src/client/app/common/views/components/cw-button.vue
index 034848a116..098aa021d1 100644
--- a/src/client/app/common/views/components/cw-button.vue
+++ b/src/client/app/common/views/components/cw-button.vue
@@ -1,11 +1,7 @@
<template>
<button class="nrvgflfuaxwgkxoynpnumyookecqrrvh" @click="toggle">
<b>{{ value ? this.$t('hide') : this.$t('show') }}</b>
- <span v-if="!value">
- <span v-if="note.text">{{ this.$t('chars', { count: length(note.text) }) | number }}</span>
- <span v-if="note.text && note.files && note.files.length > 0"> / </span>
- <span v-if="note.files && note.files.length > 0">{{ this.$t('files', { count: note.files.length }) }}</span>
- </span>
+ <span v-if="!value">{{ this.label }}</span>
</button>
</template>
@@ -13,6 +9,7 @@
import Vue from 'vue';
import i18n from '../../../i18n';
import { length } from 'stringz';
+import { concat } from '../../../../../prelude/array';
export default Vue.extend({
i18n: i18n('common/views/components/cw-button.vue'),
@@ -28,6 +25,16 @@ export default Vue.extend({
}
},
+ computed: {
+ label(): string {
+ return concat([
+ this.note.text ? [this.$t('chars', { count: length(this.note.text) })] : [],
+ this.note.files && this.note.files.length !== 0 ? [this.$t('files', { count: this.note.files.length }) ] : [],
+ this.note.poll != null ? [this.$t('poll')] : []
+ ] as string[][]).join(' / ');
+ }
+ },
+
methods: {
length,