{{ title }}
diff --git a/src/client/app/common/views/components/user-menu.vue b/src/client/app/common/views/components/user-menu.vue index 7874c4349..bcf0634fa 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 + }); + }); } } }); diff --git a/src/client/app/common/views/widgets/photo-stream.vue b/src/client/app/common/views/widgets/photo-stream.vue index 516c62632..362d7fba5 100644 --- a/src/client/app/common/views/widgets/photo-stream.vue +++ b/src/client/app/common/views/widgets/photo-stream.vue @@ -5,9 +5,9 @@{{ $t('empty-draghover') }}
diff --git a/src/client/app/desktop/views/components/friends-maker.vue b/src/client/app/desktop/views/components/friends-maker.vue index 2cb04c358..301176d48 100644 --- a/src/client/app/desktop/views/components/friends-maker.vue +++ b/src/client/app/desktop/views/components/friends-maker.vue @@ -120,13 +120,13 @@ export default Vue.extend({ margin 0 padding 16px text-align center - color #aaa + color var(--text) > .fetching margin 0 padding 16px text-align center - color #aaa + color var(--text) > [data-icon] margin-right 4px diff --git a/src/client/app/desktop/views/components/index.ts b/src/client/app/desktop/views/components/index.ts index 8ea2b602d..2edc8117a 100644 --- a/src/client/app/desktop/views/components/index.ts +++ b/src/client/app/desktop/views/components/index.ts @@ -9,7 +9,6 @@ import subNoteContent from './sub-note-content.vue'; import window from './window.vue'; import noteFormWindow from './post-form-window.vue'; import renoteFormWindow from './renote-form-window.vue'; -import mediaImage from './media-image.vue'; import mediaVideo from './media-video.vue'; import notifications from './notifications.vue'; import noteForm from './post-form.vue'; @@ -32,7 +31,6 @@ Vue.component('mk-sub-note-content', subNoteContent); Vue.component('mk-window', window); Vue.component('mk-post-form-window', noteFormWindow); Vue.component('mk-renote-form-window', renoteFormWindow); -Vue.component('mk-media-image', mediaImage); Vue.component('mk-media-video', mediaVideo); Vue.component('mk-notifications', notifications); Vue.component('mk-post-form', noteForm); diff --git a/src/client/app/desktop/views/components/media-image.vue b/src/client/app/desktop/views/components/media-image.vue deleted file mode 100644 index 446e50093..000000000 --- a/src/client/app/desktop/views/components/media-image.vue +++ /dev/null @@ -1,81 +0,0 @@ - -{{ $t('no-photos') }}
@@ -14,6 +14,8 @@ @@ -89,7 +98,7 @@ export default Vue.extend({ margin 0 padding 16px text-align center - color #aaa + color var(--text) > i margin-right 4px diff --git a/src/client/app/desktop/views/pages/user/user.vue b/src/client/app/desktop/views/pages/user/user.vue index 035015113..19f646927 100644 --- a/src/client/app/desktop/views/pages/user/user.vue +++ b/src/client/app/desktop/views/pages/user/user.vue @@ -12,7 +12,7 @@