From 048b9c295ed77f665c22f4b3f923013d0d9be990 Mon Sep 17 00:00:00 2001
From: syuilo
Date: Sat, 19 Jan 2019 19:16:48 +0900
Subject: スパム報告機能
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Resolve #1970
---
src/client/app/admin/views/abuse.vue | 87 ++++++++++++
src/client/app/admin/views/index.vue | 10 +-
.../app/common/views/components/user-menu.vue | 157 +++++++++++++++++++++
.../desktop/views/pages/deck/deck.user-column.vue | 38 +----
.../app/desktop/views/pages/user/user.header.vue | 1 -
.../app/desktop/views/pages/user/user.profile.vue | 80 +----------
src/client/app/mobile/views/pages/user.vue | 85 +----------
7 files changed, 264 insertions(+), 194 deletions(-)
create mode 100644 src/client/app/admin/views/abuse.vue
create mode 100644 src/client/app/common/views/components/user-menu.vue
(limited to 'src/client')
diff --git a/src/client/app/admin/views/abuse.vue b/src/client/app/admin/views/abuse.vue
new file mode 100644
index 0000000000..9bb77e8e6c
--- /dev/null
+++ b/src/client/app/admin/views/abuse.vue
@@ -0,0 +1,87 @@
+
+
+
+ {{ $t('title') }}
+
+
+
+
+
+ {{ $t('target') }}
+
+
+ {{ $t('reporter') }}
+
+
+
+ {{ $t('details') }}
+
+ {{ $t('remove-report') }}
+
+
+ {{ $t('@.load-more') }}
+
+
+
+
+
+
+
+
diff --git a/src/client/app/admin/views/index.vue b/src/client/app/admin/views/index.vue
index 9524a98542..5a1de2d76a 100644
--- a/src/client/app/admin/views/index.vue
+++ b/src/client/app/admin/views/index.vue
@@ -27,6 +27,7 @@
{{ $t('emoji') }}
{{ $t('announcements') }}
{{ $t('hashtags') }}
+ {{ $t('abuse') }}
@@ -63,7 +64,8 @@ import XAnnouncements from "./announcements.vue";
import XHashtags from "./hashtags.vue";
import XUsers from "./users.vue";
import XDrive from "./drive.vue";
-import { faHeadset, faArrowLeft, faShareAlt } from '@fortawesome/free-solid-svg-icons';
+import XAbuse from "./abuse.vue";
+import { faHeadset, faArrowLeft, faShareAlt, faExclamationCircle } from '@fortawesome/free-solid-svg-icons';
import { faGrin } from '@fortawesome/free-regular-svg-icons';
// Detect the user agent
@@ -81,6 +83,7 @@ export default Vue.extend({
XHashtags,
XUsers,
XDrive,
+ XAbuse,
},
provide: {
isMobile
@@ -94,7 +97,8 @@ export default Vue.extend({
faGrin,
faArrowLeft,
faHeadset,
- faShareAlt
+ faShareAlt,
+ faExclamationCircle
};
},
methods: {
diff --git a/src/client/app/common/views/components/user-menu.vue b/src/client/app/common/views/components/user-menu.vue
new file mode 100644
index 0000000000..a4a27142f9
--- /dev/null
+++ b/src/client/app/common/views/components/user-menu.vue
@@ -0,0 +1,157 @@
+
+
+
+
+
+
+
diff --git a/src/client/app/desktop/views/pages/deck/deck.user-column.vue b/src/client/app/desktop/views/pages/deck/deck.user-column.vue
index a856e74bf6..e640caa586 100644
--- a/src/client/app/desktop/views/pages/deck/deck.user-column.vue
+++ b/src/client/app/desktop/views/pages/deck/deck.user-column.vue
@@ -49,9 +49,6 @@
{{ user.followersCount | number }}
{{ $t('followers') }}
-
-
-
@@ -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
diff --git a/src/client/app/desktop/views/pages/user/user.header.vue b/src/client/app/desktop/views/pages/user/user.header.vue
index b092a0003e..c33ca84ebc 100644
--- a/src/client/app/desktop/views/pages/user/user.header.vue
+++ b/src/client/app/desktop/views/pages/user/user.header.vue
@@ -36,7 +36,6 @@
{{ user.notesCount | number }}{{ $t('posts') }}
{{ user.followingCount | number }}{{ $t('following') }}
{{ user.followersCount | number }}{{ $t('followers') }}
-
diff --git a/src/client/app/desktop/views/pages/user/user.profile.vue b/src/client/app/desktop/views/pages/user/user.profile.vue
index 58afed4001..22cbf6546f 100644
--- a/src/client/app/desktop/views/pages/user/user.profile.vue
+++ b/src/client/app/desktop/views/pages/user/user.profile.vue
@@ -9,15 +9,7 @@
-
- {{ $t('unmute') }}
- {{ $t('mute') }}
-
-
- {{ $t('unblock') }}
- {{ $t('block') }}
-
- {{ $t('push-to-a-list') }}
+ {{ $t('menu') }}
@@ -25,7 +17,7 @@
diff --git a/src/client/app/mobile/views/pages/user.vue b/src/client/app/mobile/views/pages/user.vue
index 5f3feabb6e..c475750cf2 100644
--- a/src/client/app/mobile/views/pages/user.vue
+++ b/src/client/app/mobile/views/pages/user.vue
@@ -55,7 +55,6 @@
{{ user.followersCount | number }}
{{ $t('followers') }}
-
@@ -81,7 +80,7 @@ import i18n from '../../../i18n';
import * as age from 's-age';
import parseAcct from '../../../../../misc/acct/parse';
import Progress from '../../../common/scripts/loading';
-import Menu from '../../../common/views/components/menu.vue';
+import XUserMenu from '../../../common/views/components/user-menu.vue';
import XHome from './user/home.vue';
export default Vue.extend({
@@ -127,88 +126,10 @@ export default Vue.extend({
});
},
- mention() {
- this.$post({ mention: this.user });
- },
-
menu() {
- let menu = [{
- icon: ['fas', 'list'],
- text: this.$t('push-to-list'),
- action: async () => {
- const lists = await this.$root.api('users/lists/list');
- const { canceled, result: listId } = await this.$root.dialog({
- type: null,
- title: this.$t('select-list'),
- select: {
- items: lists.map(list => ({
- value: list.id, text: list.title
- }))
- },
- showCancelButton: true
- });
- if (canceled) return;
- await this.$root.api('users/lists/push', {
- listId: listId,
- userId: this.user.id
- });
- this.$root.dialog({
- type: 'success',
- text: this.$t('list-pushed', {
- user: this.user.name,
- list: lists.find(l => l.id === listId).title
- })
- });
- }
- }, null, {
- icon: this.user.isMuted ? ['fas', 'eye'] : ['far', 'eye-slash'],
- text: this.user.isMuted ? this.$t('unmute') : this.$t('mute'),
- action: () => {
- if (this.user.isMuted) {
- this.$root.api('mute/delete', {
- userId: this.user.id
- }).then(() => {
- this.user.isMuted = false;
- }, () => {
- alert('error');
- });
- } else {
- this.$root.api('mute/create', {
- userId: this.user.id
- }).then(() => {
- this.user.isMuted = true;
- }, () => {
- alert('error');
- });
- }
- }
- }, {
- icon: 'ban',
- text: this.user.isBlocking ? this.$t('unblock') : this.$t('block'),
- action: () => {
- if (this.user.isBlocking) {
- this.$root.api('blocking/delete', {
- userId: this.user.id
- }).then(() => {
- this.user.isBlocking = false;
- }, () => {
- alert('error');
- });
- } else {
- this.$root.api('blocking/create', {
- userId: this.user.id
- }).then(() => {
- this.user.isBlocking = true;
- }, () => {
- alert('error');
- });
- }
- }
- }];
-
- this.$root.new(Menu, {
+ this.$root.new(XUserMenu, {
source: this.$refs.menu,
- items: menu
+ user: this.user
});
},
}
--
cgit v1.2.3-freya