mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-24 04:53:09 +02:00
Show moderator badge
This commit is contained in:
parent
db24dddeff
commit
99b5d94b11
3 changed files with 11 additions and 6 deletions
|
@ -5,6 +5,8 @@
|
|||
</router-link>
|
||||
<span class="is-bot" v-if="note.user.isBot">bot</span>
|
||||
<span class="username"><mk-acct :user="note.user"/></span>
|
||||
<span class="admin" v-if="note.user.isAdmin"><fa :icon="faBookmark"/></span>
|
||||
<span class="moderator" v-if="!note.user.isAdmin && note.user.isModerator"><fa :icon="farBookmark"/></span>
|
||||
<div class="info">
|
||||
<span class="mobile" v-if="note.viaMobile"><fa :icon="faMobileAlt"/></span>
|
||||
<router-link class="created-at" :to="note | notePage">
|
||||
|
@ -21,7 +23,8 @@
|
|||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import { faHome, faUnlock, faEnvelope, faMobileAlt } from '@fortawesome/free-solid-svg-icons';
|
||||
import { faHome, faUnlock, faEnvelope, faMobileAlt, faBookmark } from '@fortawesome/free-solid-svg-icons';
|
||||
import { faBookmark as farBookmark } from '@fortawesome/free-regular-svg-icons';
|
||||
|
||||
export default Vue.extend({
|
||||
props: {
|
||||
|
@ -33,7 +36,7 @@ export default Vue.extend({
|
|||
|
||||
data() {
|
||||
return {
|
||||
faHome, faUnlock, faEnvelope, faMobileAlt
|
||||
faHome, faUnlock, faEnvelope, faMobileAlt, faBookmark, farBookmark
|
||||
};
|
||||
}
|
||||
});
|
||||
|
@ -67,8 +70,7 @@ export default Vue.extend({
|
|||
margin: 0 .5em 0 0;
|
||||
padding: 1px 6px;
|
||||
font-size: 80%;
|
||||
color: var(--noteHeaderBadgeFg);
|
||||
background: var(--noteHeaderBadgeBg);
|
||||
border: solid 1px var(--divider);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
<div class="bottom">
|
||||
<span class="username"><mk-acct :user="user" :detail="true" /></span>
|
||||
<span v-if="user.isAdmin" :title="$t('isAdmin')"><fa :icon="faBookmark"/></span>
|
||||
<span v-if="!user.isAdmin && user.isModerator" :title="$t('isModerator')"><fa :icon="farBookmark"/></span>
|
||||
<span v-if="user.isLocked" :title="$t('isLocked')"><fa :icon="faLock"/></span>
|
||||
<span v-if="user.isBot" :title="$t('isBot')"><fa :icon="faRobot"/></span>
|
||||
</div>
|
||||
|
@ -30,6 +31,7 @@
|
|||
<div class="bottom">
|
||||
<span class="username"><mk-acct :user="user" :detail="true" /></span>
|
||||
<span v-if="user.isAdmin" :title="$t('isAdmin')"><fa :icon="faBookmark"/></span>
|
||||
<span v-if="!user.isAdmin && user.isModerator" :title="$t('isModerator')"><fa :icon="farBookmark"/></span>
|
||||
<span v-if="user.isLocked" :title="$t('isLocked')"><fa :icon="faLock"/></span>
|
||||
<span v-if="user.isBot" :title="$t('isBot')"><fa :icon="faRobot"/></span>
|
||||
</div>
|
||||
|
@ -106,7 +108,7 @@
|
|||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import { faEllipsisH, faRobot, faLock, faBookmark, faExclamationTriangle, faChartBar, faImage, faBirthdayCake, faMapMarker } from '@fortawesome/free-solid-svg-icons';
|
||||
import { faCalendarAlt } from '@fortawesome/free-regular-svg-icons';
|
||||
import { faCalendarAlt, faBookmark as farBookmark } from '@fortawesome/free-regular-svg-icons';
|
||||
import * as age from 's-age';
|
||||
import XUserTimeline from './index.timeline.vue';
|
||||
import XUserMenu from '../../components/user-menu.vue';
|
||||
|
@ -137,7 +139,7 @@ export default Vue.extend({
|
|||
user: null,
|
||||
error: null,
|
||||
parallaxAnimationId: null,
|
||||
faEllipsisH, faRobot, faLock, faBookmark, faExclamationTriangle, faChartBar, faImage, faBirthdayCake, faMapMarker, faCalendarAlt
|
||||
faEllipsisH, faRobot, faLock, faBookmark, farBookmark, faExclamationTriangle, faChartBar, faImage, faBirthdayCake, faMapMarker, faCalendarAlt
|
||||
};
|
||||
},
|
||||
|
||||
|
|
|
@ -159,6 +159,7 @@ export class UserRepository extends Repository<User> {
|
|||
avatarUrl: user.avatarUrl ? user.avatarUrl : config.url + '/avatar/' + user.id,
|
||||
avatarColor: user.avatarColor,
|
||||
isAdmin: user.isAdmin || falsy,
|
||||
isModerator: user.isModerator || falsy,
|
||||
isBot: user.isBot || falsy,
|
||||
isCat: user.isCat || falsy,
|
||||
|
||||
|
|
Loading…
Reference in a new issue