Skip to content
Snippets Groups Projects

Add actions to moderation menu

1 file
+ 9
11
Compare changes
  • Side-by-side
  • Inline
+ 9
11
@@ -37,19 +37,19 @@
<i v-if="isDesktop" class="el-icon-arrow-down el-icon--right"/>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="toggleUserRight(scope.row, 'admin')">
<el-dropdown-item v-if="showAdminAction(scope.row)" @click.native="toggleUserRight(scope.row, 'admin')">
{{ scope.row.roles.admin ? 'Revoke Admin' : 'Grant Admin' }}
</el-dropdown-item>
<el-dropdown-item @click.native="toggleUserRight(scope.row, 'moderator')">
<el-dropdown-item v-if="showAdminAction(scope.row)" @click.native="toggleUserRight(scope.row, 'moderator')">
{{ scope.row.roles.moderator ? 'Revoke Moderator' : 'Grant Moderator' }}
</el-dropdown-item>
<el-dropdown-item v-if="showDeactivatedButton(scope.row.id)" divided @click.native="handleDeactivation(scope.row)">
<el-dropdown-item v-if="showDeactivatedButton(scope.row.id)" :divided="showAdminAction(scope.row)" @click.native="handleDeactivation(scope.row)">
{{ scope.row.deactivated ? 'Activate account' : 'Deactivate account' }}
</el-dropdown-item>
<el-dropdown-item v-if="showDeactivatedButton(scope.row.id)" @click.native="handleDeletion(scope.row)">
Delete Account
</el-dropdown-item>
<el-dropdown-item divided @click.native="toggleTag(scope.row, 'force_nsfw')">
<el-dropdown-item :divided="showAdminAction(scope.row)" @click.native="toggleTag(scope.row, 'force_nsfw')">
Force posts to be NSFW
<i v-if="scope.row.tags.includes('force_nsfw')" class="el-icon-circle-check"/>
</el-dropdown-item>
@@ -65,11 +65,11 @@
Force posts to be followers-only
<i v-if="scope.row.tags.includes('sandbox')" class="el-icon-circle-check"/>
</el-dropdown-item>
<el-dropdown-item @click.native="toggleTag(scope.row, 'disable_remote_subscription')">
<el-dropdown-item v-if="scope.row.local" @click.native="toggleTag(scope.row, 'disable_remote_subscription')">
Disallow following user from remote instances
<i v-if="scope.row.tags.includes('disable_remote_subscription')" class="el-icon-circle-check"/>
</el-dropdown-item>
<el-dropdown-item @click.native="toggleTag(scope.row, 'disable_any_subscription')">
<el-dropdown-item v-if="scope.row.local" @click.native="toggleTag(scope.row, 'disable_any_subscription')">
Disallow following user at all
<i v-if="scope.row.tags.includes('disable_any_subscription')" class="el-icon-circle-check"/>
</el-dropdown-item>
@@ -123,11 +123,6 @@ export default {
},
width() {
return this.isMobile ? 55 : false
},
rowStyle(id) {
return {
'data-user-id': id
}
}
},
created() {
@@ -153,6 +148,9 @@ export default {
showDeactivatedButton(id) {
return this.$store.state.user.id !== id
},
showAdminAction({ local, id }) {
return local && this.showDeactivatedButton(id)
},
handleLocalUsersCheckbox(e) {
this.$store.dispatch('ToggleLocalUsersFilter', e)
},
Loading