mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-29 21:37:34 -07:00
Show on the CW button that there is a poll (#3769)
This commit is contained in:
parent
f9bd6da7c4
commit
fed4b5e032
2 changed files with 13 additions and 5 deletions
|
@ -324,6 +324,7 @@ common/views/components/cw-button.vue:
|
|||
show: "もっと見る"
|
||||
chars: "{count}文字"
|
||||
files: "{count}ファイル"
|
||||
poll: "アンケート"
|
||||
|
||||
common/views/components/messaging.vue:
|
||||
search-user: "ユーザーを探す"
|
||||
|
|
|
@ -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,
|
||||
|
||||
|
|
Loading…
Reference in a new issue