Skip to content
Snippets Groups Projects
Commit 4c21d836 authored by syuilo's avatar syuilo
Browse files

プロフィールにロールを表示するように

parent d43a4a2d
No related branches found
No related tags found
No related merge requests found
......@@ -448,6 +448,14 @@ export class UserEntityService implements OnModuleInit {
userId: user.id,
}).then(result => result >= 1)
: false,
roles: this.roleService.getUserRoles(user.id).then(roles => roles.filter(role => role.isPublic).map(role => ({
id: role.id,
name: role.name,
color: role.color,
description: role.description,
isModerator: role.isModerator,
isAdministrator: role.isAdministrator,
}))),
} : {}),
...(opts.detail && isMe ? {
......
......@@ -38,6 +38,9 @@
<span v-if="user.isBot" :title="i18n.ts.isBot"><i class="ti ti-robot"></i></span>
</div>
</div>
<div v-if="user.roles.length > 0" class="roles">
<span v-for="role in user.roles" :key="role.id" v-tooltip="role.description" class="role" :style="{ '--color': role.color }">{{ role.name }}</span>
</div>
<div class="description">
<Mfm v-if="user.description" :text="user.description" :is-note="false" :author="user" :i="$i"/>
<p v-else class="empty">{{ i18n.ts.noAccountDescription }}</p>
......@@ -337,6 +340,18 @@ onUnmounted(() => {
box-shadow: 1px 1px 3px rgba(#000, 0.2);
}
> .roles {
padding: 24px 24px 0 154px;
font-size: 0.95em;
> .role {
border: solid 1px var(--color, var(--divider));
border-radius: 999px;
margin-right: 4px;
padding: 3px 8px;
}
}
> .description {
padding: 24px 24px 24px 154px;
font-size: 0.95em;
......@@ -467,6 +482,11 @@ onUnmounted(() => {
margin: auto;
}
> .roles {
padding: 16px 16px 0 16px;
text-align: center;
}
> .description {
padding: 16px;
text-align: center;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment