Merge branch 'fix/language-inconsistency-in-account-type' into 'develop'

Fix language inconsistency and tag display on Users and User profile pages

Closes #115

See merge request pleroma/admin-fe!132
This commit is contained in:
Angelina Filippova 2020-05-29 19:44:31 +00:00
commit 019b24245a
3 changed files with 31 additions and 20 deletions

View file

@ -171,16 +171,16 @@ export default {
id: 'ID', id: 'ID',
name: 'Name', name: 'Name',
status: 'Status', status: 'Status',
local: 'local', local: 'Local',
external: 'external', external: 'External',
deactivated: 'deactivated', deactivated: 'Deactivated',
active: 'active', active: 'Active',
unconfirmed: 'unconfirmed', unconfirmed: 'Unconfirmed',
actions: 'Actions', actions: 'Actions',
activate: 'Activate', activate: 'Activate',
deactivate: 'Deactivate', deactivate: 'Deactivate',
admin: 'admin', admin: 'Admin',
moderator: 'moderator', moderator: 'Moderator',
moderation: 'Moderation', moderation: 'Moderation',
revokeAdmin: 'Revoke Admin', revokeAdmin: 'Revoke Admin',
grantAdmin: 'Grant Admin', grantAdmin: 'Grant Admin',
@ -205,8 +205,8 @@ export default {
moderateUser: 'Moderate user', moderateUser: 'Moderate user',
moderateUsers: 'Moderate multiple users', moderateUsers: 'Moderate multiple users',
createAccount: 'Create new account', createAccount: 'Create new account',
apply: 'apply', apply: 'Apply',
remove: 'remove', remove: 'Remove',
grantRightConfirmation: 'Are you sure you want to grant {right} rights to all selected users?', grantRightConfirmation: 'Are you sure you want to grant {right} rights to all selected users?',
revokeRightConfirmation: 'Are you sure you want to revoke {right} rights from all selected users?', revokeRightConfirmation: 'Are you sure you want to revoke {right} rights from all selected users?',
activateMultipleUsersConfirmation: 'Are you sure you want to activate accounts of all selected users?', activateMultipleUsersConfirmation: 'Are you sure you want to activate accounts of all selected users?',
@ -256,15 +256,15 @@ export default {
tags: 'Tags', tags: 'Tags',
moderator: 'Moderator', moderator: 'Moderator',
admin: 'Admin', admin: 'Admin',
local: 'local', local: 'Local',
external: 'external', external: 'External',
localUppercase: 'Local', accountType: 'Account type',
nickname: 'Nickname', nickname: 'Nickname',
recentStatuses: 'Recent Statuses', recentStatuses: 'Recent Statuses',
roles: 'Roles', roles: 'Roles',
activeUppercase: 'Active', active: 'Active',
active: 'active', status: 'Status',
deactivated: 'deactivated', deactivated: 'Deactivated',
noStatuses: 'No statuses to show', noStatuses: 'No statuses to show',
securitySettings: { securitySettings: {
email: 'Email', email: 'Email',
@ -284,7 +284,7 @@ export default {
}, },
usersFilter: { usersFilter: {
inputPlaceholder: 'Select filter', inputPlaceholder: 'Select filter',
byUserType: 'By user type', byAccountType: 'By account type',
local: 'Local', local: 'Local',
external: 'External', external: 'External',
byStatus: 'By status', byStatus: 'By status',

View file

@ -6,7 +6,7 @@
multiple multiple
class="select-field" class="select-field"
@change="toggleFilters"> @change="toggleFilters">
<el-option-group :label="$t('usersFilter.byUserType')"> <el-option-group :label="$t('usersFilter.byAccountType')">
<el-option value="local">{{ $t('usersFilter.local') }}</el-option> <el-option value="local">{{ $t('usersFilter.local') }}</el-option>
<el-option value="external">{{ $t('usersFilter.external') }}</el-option> <el-option value="external">{{ $t('usersFilter.external') }}</el-option>
</el-option-group> </el-option-group>

View file

@ -59,7 +59,7 @@
<tr class="el-table__row"> <tr class="el-table__row">
<td>{{ $t('userProfile.tags') }}</td> <td>{{ $t('userProfile.tags') }}</td>
<td> <td>
<el-tag v-for="tag in user.tags" :key="tag" class="user-profile-tag">{{ tag }}</el-tag> <el-tag v-for="tag in user.tags" :key="tag" class="user-profile-tag">{{ humanizeTag(tag) }}</el-tag>
<span v-if="user.tags.length === 0"></span> <span v-if="user.tags.length === 0"></span>
</td> </td>
</tr> </tr>
@ -76,14 +76,14 @@
</td> </td>
</tr> </tr>
<tr class="el-table__row"> <tr class="el-table__row">
<td>{{ $t('userProfile.localUppercase') }}</td> <td>{{ $t('userProfile.accountType') }}</td>
<td> <td>
<el-tag v-if="user.local" type="info">{{ $t('userProfile.local') }}</el-tag> <el-tag v-if="user.local" type="info">{{ $t('userProfile.local') }}</el-tag>
<el-tag v-if="!user.local" type="info">{{ $t('userProfile.external') }}</el-tag> <el-tag v-if="!user.local" type="info">{{ $t('userProfile.external') }}</el-tag>
</td> </td>
</tr> </tr>
<tr class="el-table__row"> <tr class="el-table__row">
<td>{{ $t('userProfile.activeUppercase') }}</td> <td>{{ $t('userProfile.status') }}</td>
<td> <td>
<el-tag v-if="!user.deactivated" type="success">{{ $t('userProfile.active') }}</el-tag> <el-tag v-if="!user.deactivated" type="success">{{ $t('userProfile.active') }}</el-tag>
<el-tag v-if="user.deactivated" type="danger">{{ $t('userProfile.deactivated') }}</el-tag> <el-tag v-if="user.deactivated" type="danger">{{ $t('userProfile.deactivated') }}</el-tag>
@ -177,6 +177,17 @@ export default {
this.resetPasswordDialogOpen = false this.resetPasswordDialogOpen = false
this.$store.dispatch('RemovePasswordToken') this.$store.dispatch('RemovePasswordToken')
}, },
humanizeTag(tag) {
const mapTags = {
'force_nsfw': 'Force NSFW',
'strip_media': 'Strip Media',
'force_unlisted': 'Force Unlisted',
'sandbox': 'Sandbox',
'disable_remote_subscription': 'Disable remote subscription',
'disable_any_subscription': 'Disable any subscription'
}
return mapTags[tag]
},
onTogglePrivate() { onTogglePrivate() {
this.$store.dispatch('FetchUserProfile', { userId: this.$route.params.id, godmode: this.showPrivate }) this.$store.dispatch('FetchUserProfile', { userId: this.$route.params.id, godmode: this.showPrivate })
}, },