スパム報告機能

Resolve #1970
This commit is contained in:
syuilo 2019-01-19 19:16:48 +09:00
parent ac5d798cde
commit 048b9c295e
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
12 changed files with 486 additions and 212 deletions

View file

@ -49,9 +49,6 @@
<b>{{ user.followersCount | number }}</b>
<span>{{ $t('followers') }}</span>
</div>
<div class="mention">
<button @click="mention" :title="$t('mention')"><fa icon="at"/></button>
</div>
</div>
</div>
<div class="pinned" v-if="user.pinnedNotes && user.pinnedNotes.length > 0">
@ -100,8 +97,7 @@ import parseAcct from '../../../../../../misc/acct/parse';
import XColumn from './deck.column.vue';
import XNotes from './deck.notes.vue';
import XNote from '../../components/note.vue';
import Menu from '../../../../common/views/components/menu.vue';
import MkUserListsWindow from '../../components/user-lists-window.vue';
import XUserMenu from '../../../../common/views/components/user-menu.vue';
import { concat } from '../../../../../../prelude/array';
import * as ApexCharts from 'apexcharts';
@ -306,33 +302,10 @@ export default Vue.extend({
return promise;
},
mention() {
this.$post({ mention: this.user });
},
menu() {
let menu = [{
icon: 'list',
text: this.$t('push-to-a-list'),
action: () => {
const w = this.$root.new(MkUserListsWindow);
w.$once('choosen', async list => {
w.close();
await this.$root.api('users/lists/push', {
listId: list.id,
userId: this.user.id
});
this.$root.dialog({
type: 'success',
splash: true
});
});
}
}];
this.$root.new(Menu, {
this.$root.new(XUserMenu, {
source: this.$refs.menu,
items: menu
user: this.user
});
},
@ -459,7 +432,7 @@ export default Vue.extend({
> .counts
display grid
grid-template-columns 2fr 2fr 2fr 1fr
grid-template-columns 2fr 2fr 2fr
margin-top 8px
border-top solid var(--lineWidth) var(--faceDivider)
@ -476,9 +449,6 @@ export default Vue.extend({
font-size 80%
opacity 0.7
> .mention
display flex
> *
> p.caption
margin 0

View file

@ -36,7 +36,6 @@
<span class="notes-count"><b>{{ user.notesCount | number }}</b>{{ $t('posts') }}</span>
<router-link :to="user | userPage('following')" class="following clickable"><b>{{ user.followingCount | number }}</b>{{ $t('following') }}</router-link>
<router-link :to="user | userPage('followers')" class="followers clickable"><b>{{ user.followersCount | number }}</b>{{ $t('followers') }}</router-link>
<button @click="mention" :title="$t('mention')"><fa icon="at"/></button>
</div>
</div>
</div>

View file

@ -9,15 +9,7 @@
</p>
</div>
<div class="action-form">
<ui-button @click="user.isMuted ? unmute() : mute()" v-if="$store.state.i.id != user.id">
<span v-if="user.isMuted"><fa icon="eye"/> {{ $t('unmute') }}</span>
<span v-else><fa :icon="['far', 'eye-slash']"/> {{ $t('mute') }}</span>
</ui-button>
<ui-button @click="user.isBlocking ? unblock() : block()" v-if="$store.state.i.id != user.id">
<span v-if="user.isBlocking"><fa icon="ban"/> {{ $t('unblock') }}</span>
<span v-else><fa icon="ban"/> {{ $t('block') }}</span>
</ui-button>
<ui-button @click="list"><fa icon="list"/> {{ $t('push-to-a-list') }}</ui-button>
<ui-button @click="menu" ref="menu">{{ $t('menu') }}</ui-button>
</div>
</div>
</template>
@ -25,7 +17,7 @@
<script lang="ts">
import Vue from 'vue';
import i18n from '../../../../i18n';
import MkUserListsWindow from '../../components/user-lists-window.vue';
import XUserMenu from '../../../../common/views/components/user-menu.vue';
export default Vue.extend({
i18n: i18n('desktop/views/pages/user/user.profile.vue'),
@ -52,72 +44,12 @@ export default Vue.extend({
});
},
mute() {
this.$root.api('mute/create', {
userId: this.user.id
}).then(() => {
this.user.isMuted = true;
}, () => {
alert('error');
menu() {
this.$root.new(XUserMenu, {
source: this.$refs.menu.$el,
user: this.user
});
},
unmute() {
this.$root.api('mute/delete', {
userId: this.user.id
}).then(() => {
this.user.isMuted = false;
}, () => {
alert('error');
});
},
block() {
this.$root.dialog({
type: 'warning',
text: this.$t('block-confirm'),
showCancelButton: true
}).then(({ canceled }) => {
if (canceled) return;
this.$root.api('blocking/create', {
userId: this.user.id
}).then(() => {
this.user.isBlocking = true;
}, () => {
alert('error');
});
});
},
unblock() {
this.$root.api('blocking/delete', {
userId: this.user.id
}).then(() => {
this.user.isBlocking = false;
}, () => {
alert('error');
});
},
list() {
const w = this.$root.new(MkUserListsWindow);
w.$once('choosen', async list => {
w.close();
await this.$root.api('users/lists/push', {
listId: list.id,
userId: this.user.id
});
this.$root.dialog({
type: 'success',
title: 'Done!',
text: this.$t('list-pushed', {
user: this.user.name,
list: list.title
})
});
});
}
}
});
</script>