diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2020-02-18 08:41:32 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2020-02-18 08:41:32 +0900 |
| commit | a54de07260c3555d0230492970448604ffb9d586 (patch) | |
| tree | 0650c5de48af1cd5b5945da6a3dff6093ceaefd1 /src/client/components/note.vue | |
| parent | Fix type (diff) | |
| download | misskey-a54de07260c3555d0230492970448604ffb9d586.tar.gz misskey-a54de07260c3555d0230492970448604ffb9d586.tar.bz2 misskey-a54de07260c3555d0230492970448604ffb9d586.zip | |
Resolve #5963
Diffstat (limited to 'src/client/components/note.vue')
| -rw-r--r-- | src/client/components/note.vue | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/src/client/components/note.vue b/src/client/components/note.vue index 963e2045f1..e6b522d8d0 100644 --- a/src/client/components/note.vue +++ b/src/client/components/note.vue @@ -10,6 +10,7 @@ <x-sub v-for="note in conversation" :key="note.id" :note="note"/> <x-sub :note="appearNote.reply" class="reply-to" v-if="appearNote.reply"/> <div class="pinned" v-if="pinned"><fa :icon="faThumbtack"/> {{ $t('pinnedNote') }}</div> + <div class="pinned" v-if="appearNote._prInjectionId_"><fa :icon="faBullhorn"/> {{ $t('promotion') }}</div> <div class="renote" v-if="isRenote"> <mk-avatar class="avatar" :user="note.user"/> <fa :icon="faRetweet"/> @@ -83,7 +84,7 @@ <script lang="ts"> import Vue from 'vue'; -import { faStar, faLink, faExternalLinkSquareAlt, faPlus, faMinus, faRetweet, faReply, faReplyAll, faEllipsisH, faHome, faUnlock, faEnvelope, faThumbtack, faBan, faQuoteRight } from '@fortawesome/free-solid-svg-icons'; +import { faBullhorn, faStar, faLink, faExternalLinkSquareAlt, faPlus, faMinus, faRetweet, faReply, faReplyAll, faEllipsisH, faHome, faUnlock, faEnvelope, faThumbtack, faBan, faQuoteRight } from '@fortawesome/free-solid-svg-icons'; import { faCopy, faTrashAlt, faEye, faEyeSlash } from '@fortawesome/free-regular-svg-icons'; import { parse } from '../../mfm/parse'; import { sum, unique } from '../../prelude/array'; @@ -140,7 +141,7 @@ export default Vue.extend({ replies: [], showContent: false, hideThisNote: false, - faPlus, faMinus, faRetweet, faReply, faReplyAll, faEllipsisH, faHome, faUnlock, faEnvelope, faThumbtack, faBan + faBullhorn, faPlus, faMinus, faRetweet, faReply, faReplyAll, faEllipsisH, faHome, faUnlock, faEnvelope, faThumbtack, faBan }; }, @@ -522,6 +523,15 @@ export default Vue.extend({ text: this.$t('pin'), action: () => this.togglePin(true) } : undefined, + ...(this.$store.state.i.isModerator || this.$store.state.i.isAdmin ? [ + null, + { + icon: faBullhorn, + text: this.$t('promote'), + action: this.promote + }] + : [] + ), ...(this.appearNote.userId == this.$store.state.i.id ? [ null, { @@ -614,6 +624,30 @@ export default Vue.extend({ }); }, + async promote() { + const { canceled, result: days } = await this.$root.dialog({ + title: this.$t('numberOfDays'), + input: { type: 'number' } + }); + + if (canceled) return; + + this.$root.api('admin/promo/create', { + noteId: this.appearNote.id, + expiresAt: Date.now() + (86400000 * days) + }).then(() => { + this.$root.dialog({ + type: 'success', + iconOnly: true, autoClose: true + }); + }).catch(e => { + this.$root.dialog({ + type: 'error', + text: e + }); + }); + }, + focus() { this.$el.focus(); }, |