Add an optional setting to remain deleted note (#3271)

Co-authored-by: Aya Morisawa <AyaMorisawa4869@gmail.com>
Co-authored-by: syuilo <syuilotan@yahoo.co.jp>
This commit is contained in:
Aya Morisawa 2018-11-16 23:13:37 +09:00 committed by syuilo
parent 8569970fbe
commit 57d80932a4
5 changed files with 25 additions and 5 deletions

View file

@ -850,6 +850,7 @@ desktop/views/components/settings.vue:
show-renoted-my-notes: "自分の投稿のRenoteをタイムラインに表示する" show-renoted-my-notes: "自分の投稿のRenoteをタイムラインに表示する"
show-local-renotes: "ローカルの投稿のRenoteをタイムラインに表示する" show-local-renotes: "ローカルの投稿のRenoteをタイムラインに表示する"
show-maps: "マップの自動展開" show-maps: "マップの自動展開"
remain-deleted-note: "削除された投稿を表示し続ける"
deck-column-align: "デッキのカラムの位置" deck-column-align: "デッキのカラムの位置"
deck-column-align-center: "中央" deck-column-align-center: "中央"
deck-column-align-left: "左" deck-column-align-left: "左"

View file

@ -2,7 +2,7 @@
<div <div
class="note" class="note"
:class="{ mini }" :class="{ mini }"
v-show="appearNote.deletedAt == null && !hideThisNote" v-show="(this.$store.state.settings.remainDeletedNote || appearNote.deletedAt == null) && !hideThisNote"
:tabindex="appearNote.deletedAt == null ? '-1' : null" :tabindex="appearNote.deletedAt == null ? '-1' : null"
v-hotkey="keymap" v-hotkey="keymap"
:title="title" :title="title"
@ -32,7 +32,7 @@
<mk-avatar class="avatar" :user="appearNote.user"/> <mk-avatar class="avatar" :user="appearNote.user"/>
<div class="main"> <div class="main">
<mk-note-header class="header" :note="appearNote" :mini="mini"/> <mk-note-header class="header" :note="appearNote" :mini="mini"/>
<div class="body"> <div class="body" v-if="appearNote.deletedAt == null">
<p v-if="appearNote.cw != null" class="cw"> <p v-if="appearNote.cw != null" class="cw">
<span class="text" v-if="appearNote.cw != ''">{{ appearNote.cw }}</span> <span class="text" v-if="appearNote.cw != ''">{{ appearNote.cw }}</span>
<mk-cw-button v-model="showContent"/> <mk-cw-button v-model="showContent"/>
@ -53,7 +53,7 @@
<mk-url-preview v-for="url in urls" :url="url" :key="url" :mini="mini"/> <mk-url-preview v-for="url in urls" :url="url" :key="url" :mini="mini"/>
</div> </div>
</div> </div>
<footer> <footer v-if="appearNote.deletedAt == null">
<span class="app" v-if="appearNote.app && mini && $store.state.settings.showVia">via <b>{{ appearNote.app.name }}</b></span> <span class="app" v-if="appearNote.app && mini && $store.state.settings.showVia">via <b>{{ appearNote.app.name }}</b></span>
<mk-reactions-viewer :note="appearNote" ref="reactionsViewer"/> <mk-reactions-viewer :note="appearNote" ref="reactionsViewer"/>
<button class="replyButton" @click="reply()" :title="$t('reply')"> <button class="replyButton" @click="reply()" :title="$t('reply')">
@ -71,6 +71,7 @@
<fa icon="ellipsis-h"/> <fa icon="ellipsis-h"/>
</button> </button>
</footer> </footer>
<div class="deleted" v-if="appearNote.deletedAt != null">{{ $t('deleted') }}</div>
</div> </div>
</article> </article>
<div class="replies" v-if="detail && replies.length > 0"> <div class="replies" v-if="detail && replies.length > 0">
@ -89,6 +90,7 @@ import noteSubscriber from '../../../common/scripts/note-subscriber';
export default Vue.extend({ export default Vue.extend({
i18n: i18n('desktop/views/components/note.vue'), i18n: i18n('desktop/views/components/note.vue'),
components: { components: {
XSub XSub
}, },
@ -343,6 +345,7 @@ export default Vue.extend({
margin-left 0.5em margin-left 0.5em
color var(--noteHeaderInfo) color var(--noteHeaderInfo)
font-size 0.8em font-size 0.8em
> button > button
margin 0 28px 0 0 margin 0 28px 0 0
padding 0 8px padding 0 8px
@ -376,6 +379,10 @@ export default Vue.extend({
&.reacted, &.reacted:hover &.reacted, &.reacted:hover
color var(--noteActionsReactionHover) color var(--noteActionsReactionHover)
> .deleted
color var(--noteText)
opacity 0.7
</style> </style>
<style lang="stylus" module> <style lang="stylus" module>

View file

@ -130,6 +130,7 @@
<ui-switch v-model="showReplyTarget">{{ $t('show-reply-target') }}</ui-switch> <ui-switch v-model="showReplyTarget">{{ $t('show-reply-target') }}</ui-switch>
<ui-switch v-model="showMaps">{{ $t('show-maps') }}</ui-switch> <ui-switch v-model="showMaps">{{ $t('show-maps') }}</ui-switch>
<ui-switch v-model="disableAnimatedMfm">{{ $t('@.disable-animated-mfm') }}</ui-switch> <ui-switch v-model="disableAnimatedMfm">{{ $t('@.disable-animated-mfm') }}</ui-switch>
<ui-switch v-model="remainDeletedNote">{{ $t('remain-deleted-note') }}</ui-switch>
</section> </section>
<section> <section>
<header>{{ $t('deck-column-align') }}</header> <header>{{ $t('deck-column-align') }}</header>
@ -529,6 +530,11 @@ export default Vue.extend({
disableAnimatedMfm: { disableAnimatedMfm: {
get() { return this.$store.state.settings.disableAnimatedMfm; }, get() { return this.$store.state.settings.disableAnimatedMfm; },
set(value) { this.$store.dispatch('settings/set', { key: 'disableAnimatedMfm', value }); } set(value) { this.$store.dispatch('settings/set', { key: 'disableAnimatedMfm', value }); }
},
remainDeletedNote: {
get() { return this.$store.state.settings.remainDeletedNote; },
set(value) { this.$store.dispatch('settings/set', { key: 'remainDeletedNote', value }); }
} }
}, },
created() { created() {

View file

@ -28,7 +28,7 @@
<mk-avatar class="avatar" :user="appearNote.user" v-if="$store.state.device.postStyle != 'smart'"/> <mk-avatar class="avatar" :user="appearNote.user" v-if="$store.state.device.postStyle != 'smart'"/>
<div class="main"> <div class="main">
<mk-note-header class="header" :note="appearNote" :mini="true"/> <mk-note-header class="header" :note="appearNote" :mini="true"/>
<div class="body"> <div class="body" v-if="appearNote.deletedAt == null">
<p v-if="appearNote.cw != null" class="cw"> <p v-if="appearNote.cw != null" class="cw">
<span class="text" v-if="appearNote.cw != ''">{{ appearNote.cw }}</span> <span class="text" v-if="appearNote.cw != ''">{{ appearNote.cw }}</span>
<mk-cw-button v-model="showContent"/> <mk-cw-button v-model="showContent"/>
@ -50,7 +50,7 @@
</div> </div>
<span class="app" v-if="appearNote.app && $store.state.settings.showVia">via <b>{{ appearNote.app.name }}</b></span> <span class="app" v-if="appearNote.app && $store.state.settings.showVia">via <b>{{ appearNote.app.name }}</b></span>
</div> </div>
<footer> <footer v-if="appearNote.deletedAt == null">
<mk-reactions-viewer :note="appearNote" ref="reactionsViewer"/> <mk-reactions-viewer :note="appearNote" ref="reactionsViewer"/>
<button @click="reply()"> <button @click="reply()">
<template v-if="appearNote.reply"><fa icon="reply-all"/></template> <template v-if="appearNote.reply"><fa icon="reply-all"/></template>
@ -67,6 +67,7 @@
<fa icon="ellipsis-h"/> <fa icon="ellipsis-h"/>
</button> </button>
</footer> </footer>
<div class="deleted" v-if="appearNote.deletedAt != null">{{ $t('deleted') }}</div>
</div> </div>
</article> </article>
</div> </div>
@ -355,6 +356,10 @@ export default Vue.extend({
&.reacted &.reacted
color var(--primary) color var(--primary)
> .deleted
color var(--noteText)
opacity 0.7
</style> </style>
<style lang="stylus" module> <style lang="stylus" module>

View file

@ -15,6 +15,7 @@ const defaultSettings = {
tagTimelines: [], tagTimelines: [],
fetchOnScroll: true, fetchOnScroll: true,
showMaps: true, showMaps: true,
remainDeletedNote: false,
showPostFormOnTopOfTl: false, showPostFormOnTopOfTl: false,
suggestRecentHashtags: true, suggestRecentHashtags: true,
showClockOnHeader: true, showClockOnHeader: true,