Merge branch 'add-admin-and-moderator-fields-to-user-card-view' into 'develop'
Add admin and moderator indicators to the user profile See merge request pleroma/pleroma-fe!519
This commit is contained in:
commit
62b3b9b8d4
8 changed files with 36 additions and 3 deletions
|
@ -79,6 +79,12 @@ export default {
|
|||
set (color) {
|
||||
this.$store.dispatch('setHighlight', { user: this.user.screen_name, color })
|
||||
}
|
||||
},
|
||||
visibleRole () {
|
||||
const validRole = (this.user.role === 'admin' || this.user.role === 'moderator')
|
||||
const showRole = this.isOtherUser || this.user.show_role
|
||||
|
||||
return validRole && showRole && this.user.role
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
</div>
|
||||
|
||||
<router-link class='user-screen-name' :to="userProfileLink(user)">
|
||||
<span class="handle">@{{user.screen_name}}</span><span v-if="user.locked"><i class="icon icon-lock"></i></span>
|
||||
<span class="handle">@{{user.screen_name}}
|
||||
<span class="alert staff" v-if="!hideBio && !!visibleRole">{{visibleRole}}</span>
|
||||
</span><span v-if="user.locked"><i class="icon icon-lock"></i></span>
|
||||
<span v-if="!hideUserStatsLocal && !hideBio" class="dailyAvg">{{dailyAvg}} {{ $t('user_card.per_day') }}</span>
|
||||
</router-link>
|
||||
</div>
|
||||
|
@ -247,6 +249,15 @@
|
|||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
// TODO use proper colors
|
||||
.staff {
|
||||
text-transform: capitalize;
|
||||
color: $fallback--text;
|
||||
color: var(--btnText, $fallback--text);
|
||||
background-color: $fallback--fg;
|
||||
background-color: var(--btn, $fallback--fg);
|
||||
}
|
||||
}
|
||||
|
||||
.user-meta {
|
||||
|
|
|
@ -14,6 +14,8 @@ const UserSettings = {
|
|||
newDefaultScope: this.$store.state.users.currentUser.default_scope,
|
||||
hideFollows: this.$store.state.users.currentUser.hide_follows,
|
||||
hideFollowers: this.$store.state.users.currentUser.hide_followers,
|
||||
showRole: this.$store.state.users.currentUser.show_role,
|
||||
role: this.$store.state.users.currentUser.role,
|
||||
followList: null,
|
||||
followImportError: false,
|
||||
followsImported: false,
|
||||
|
@ -71,6 +73,8 @@ const UserSettings = {
|
|||
const no_rich_text = this.newNoRichText
|
||||
const hide_follows = this.hideFollows
|
||||
const hide_followers = this.hideFollowers
|
||||
const show_role = this.showRole
|
||||
|
||||
/* eslint-enable camelcase */
|
||||
this.$store.state.api.backendInteractor
|
||||
.updateProfile({
|
||||
|
@ -83,7 +87,8 @@ const UserSettings = {
|
|||
default_scope,
|
||||
no_rich_text,
|
||||
hide_follows,
|
||||
hide_followers
|
||||
hide_followers,
|
||||
show_role
|
||||
/* eslint-enable camelcase */
|
||||
}}).then((user) => {
|
||||
if (!user.error) {
|
||||
|
|
|
@ -37,6 +37,11 @@
|
|||
<input type="checkbox" v-model="hideFollowers" id="account-hide-followers">
|
||||
<label for="account-hide-followers">{{$t('settings.hide_followers_description')}}</label>
|
||||
</p>
|
||||
<p>
|
||||
<input type="checkbox" v-model="showRole" id="account-show-role">
|
||||
<label for="account-show-role" v-if="role === 'admin'">{{$t('settings.show_admin_badge')}}</label>
|
||||
<label for="account-show-role" v-if="role === 'moderator'">{{$t('settings.show_moderator_badge')}}</label>
|
||||
</p>
|
||||
<button :disabled='newName && newName.length === 0' class="btn btn-default" @click="updateProfile">{{$t('general.submit')}}</button>
|
||||
</div>
|
||||
<div class="setting-item">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue