2023-07-27 05:31:52 +00:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2023-01-12 12:02:26 +00:00
|
|
|
<template>
|
2023-02-22 05:43:18 +00:00
|
|
|
<MkA v-adaptive-bg :to="forModeration ? `/admin/roles/${role.id}` : `/roles/${role.id}`" class="_panel" :class="$style.root" tabindex="-1" :style="{ '--color': role.color }">
|
2023-01-14 02:14:14 +00:00
|
|
|
<div :class="$style.title">
|
2023-01-15 21:35:16 +00:00
|
|
|
<span :class="$style.icon">
|
2023-02-22 05:43:18 +00:00
|
|
|
<template v-if="role.iconUrl">
|
|
|
|
<img :class="$style.badge" :src="role.iconUrl"/>
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
2023-09-30 19:53:52 +00:00
|
|
|
<i v-if="role.isAdministrator" class="ph-crown ph-bold ph-lg" style="color: var(--accent);"></i>
|
|
|
|
<i v-else-if="role.isModerator" class="ph-shield ph-bold ph-lg" style="color: var(--accent);"></i>
|
|
|
|
<i v-else class="ph-user ph-bold ph-lg" style="opacity: 0.7;"></i>
|
2023-02-22 05:43:18 +00:00
|
|
|
</template>
|
2023-01-15 21:35:16 +00:00
|
|
|
</span>
|
2023-01-14 02:14:14 +00:00
|
|
|
<span :class="$style.name">{{ role.name }}</span>
|
2023-05-18 09:45:49 +00:00
|
|
|
<template v-if="detailed">
|
|
|
|
<span v-if="role.target === 'manual'" :class="$style.users">{{ role.usersCount }} users</span>
|
|
|
|
<span v-else-if="role.target === 'conditional'" :class="$style.users">({{ i18n.ts._role.conditional }})</span>
|
|
|
|
</template>
|
2023-01-14 02:14:14 +00:00
|
|
|
</div>
|
2023-01-12 12:02:26 +00:00
|
|
|
<div :class="$style.description">{{ role.description }}</div>
|
|
|
|
</MkA>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
2023-09-19 07:37:43 +00:00
|
|
|
import { i18n } from '@/i18n.js';
|
2023-01-12 12:02:26 +00:00
|
|
|
|
2023-05-18 09:45:49 +00:00
|
|
|
const props = withDefaults(defineProps<{
|
2023-01-12 12:02:26 +00:00
|
|
|
role: any;
|
2023-02-22 05:43:18 +00:00
|
|
|
forModeration: boolean;
|
2023-05-18 09:45:49 +00:00
|
|
|
detailed: boolean;
|
|
|
|
}>(), {
|
|
|
|
detailed: true,
|
|
|
|
});
|
2023-01-12 12:02:26 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
.root {
|
|
|
|
display: block;
|
|
|
|
padding: 16px 20px;
|
|
|
|
border-left: solid 6px var(--color);
|
|
|
|
}
|
|
|
|
|
|
|
|
.title {
|
2023-01-14 02:14:14 +00:00
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
|
2023-01-15 21:35:16 +00:00
|
|
|
.icon {
|
|
|
|
margin-right: 8px;
|
|
|
|
}
|
|
|
|
|
2023-02-22 05:43:18 +00:00
|
|
|
.badge {
|
|
|
|
height: 1.3em;
|
|
|
|
vertical-align: -20%;
|
|
|
|
}
|
|
|
|
|
2023-01-14 02:14:14 +00:00
|
|
|
.name {
|
2023-01-12 12:02:26 +00:00
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
2023-01-14 02:14:14 +00:00
|
|
|
.users {
|
|
|
|
margin-left: auto;
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
|
|
|
|
2023-01-12 12:02:26 +00:00
|
|
|
.description {
|
|
|
|
opacity: 0.7;
|
2023-01-15 21:06:05 +00:00
|
|
|
font-size: 85%;
|
2023-01-12 12:02:26 +00:00
|
|
|
}
|
|
|
|
</style>
|