summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-02-02 23:20:40 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-02-02 23:20:40 +0900
commit2b0cb6d7285bf3d60406233afd9d2648ac0212bf (patch)
treecfc40b28b90c69c604a240941bab5925d29f6f0b
parent[Client] Improve usability (diff)
downloadmisskey-2b0cb6d7285bf3d60406233afd9d2648ac0212bf.tar.gz
misskey-2b0cb6d7285bf3d60406233afd9d2648ac0212bf.tar.bz2
misskey-2b0cb6d7285bf3d60406233afd9d2648ac0212bf.zip
[Client] Resolve #3226
-rw-r--r--CHANGELOG.md1
-rw-r--r--locales/ja-JP.yml4
-rw-r--r--src/client/app/common/views/components/user-menu.vue49
3 files changed, 53 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4da370e410..d9278ff6f8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@ unreleased
* 動画のサムネイルを作成するように
* リモートの外部サービス認証情報を表示するように
* public の Renote/Reply/Quote先 が public以外 だったら、public => homeに
+* ユーザーページから管理者/モデレーターがアカウントのサイレンス/凍結をできるように
* 凍結されたユーザーをタイムライン等に表示しないように
* おすすめのアンケートでミュートユーザーのものは表示しないように
* おすすめのアンケートで凍結済みユーザーのものは表示しないように
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index be933b2d9b..fd325f13c1 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -391,6 +391,10 @@ common/views/components/user-menu.vue:
report-abuse: "スパムを報告"
report-abuse-detail: "どのような迷惑行為を行っていますか?"
report-abuse-reported: "管理者に報告されました。ご協力ありがとうございました。"
+ silence: "サイレンス"
+ unsilence: "サイレンス解除"
+ suspend: "凍結"
+ unsuspend: "凍結解除"
common/views/components/poll.vue:
vote-to: "「{}」に投票する"
diff --git a/src/client/app/common/views/components/user-menu.vue b/src/client/app/common/views/components/user-menu.vue
index 7874c43493..bcf0634fa6 100644
--- a/src/client/app/common/views/components/user-menu.vue
+++ b/src/client/app/common/views/components/user-menu.vue
@@ -8,7 +8,8 @@
import Vue from 'vue';
import i18n from '../../../i18n';
import copyToClipboard from '../../../common/scripts/copy-to-clipboard';
-import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons';
+import { faExclamationCircle, faMicrophoneSlash } from '@fortawesome/free-solid-svg-icons';
+import { faSnowflake } from '@fortawesome/free-regular-svg-icons';
export default Vue.extend({
i18n: i18n('common/views/components/user-menu.vue'),
@@ -40,6 +41,18 @@ export default Vue.extend({
action: this.reportAbuse
}];
+ if (this.$store.getters.isSignedIn && (this.$store.state.i.isAdmin || this.$store.state.i.isModerator)) {
+ menu = menu.concat([null, {
+ icon: faMicrophoneSlash,
+ text: this.user.isSilenced ? this.$t('unsilence') : this.$t('silence'),
+ action: this.toggleSilence
+ }, {
+ icon: faSnowflake,
+ text: this.user.isSuspended ? this.$t('unsuspend') : this.$t('suspend'),
+ action: this.toggleSuspend
+ }]);
+ }
+
return {
items: menu
};
@@ -148,6 +161,40 @@ export default Vue.extend({
text: e
});
});
+ },
+
+ toggleSilence() {
+ this.$root.api(this.user.isSilenced ? 'admin/unsilence-user' : 'admin/silence-user', {
+ userId: this.user.id
+ }).then(() => {
+ this.user.isSilenced = !this.user.isSilenced;
+ this.$root.dialog({
+ type: 'success',
+ splash: true
+ });
+ }, e => {
+ this.$root.dialog({
+ type: 'error',
+ text: e
+ });
+ });
+ },
+
+ toggleSuspend() {
+ this.$root.api(this.user.isSuspended ? 'admin/unsuspend-user' : 'admin/suspend-user', {
+ userId: this.user.id
+ }).then(() => {
+ this.user.isSuspended = !this.user.isSuspended;
+ this.$root.dialog({
+ type: 'success',
+ splash: true
+ });
+ }, e => {
+ this.$root.dialog({
+ type: 'error',
+ text: e
+ });
+ });
}
}
});