2020-08-05 14:39:17 +02:00
|
|
|
<template>
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-content">
|
2020-09-29 09:53:48 +02:00
|
|
|
<div>
|
|
|
|
<div class="media">
|
|
|
|
<div class="media-left">
|
|
|
|
<figure class="image is-48x48" v-if="member.parent.avatar">
|
|
|
|
<img class="is-rounded" :src="member.parent.avatar.url" alt="" />
|
|
|
|
</figure>
|
|
|
|
<b-icon v-else size="is-large" icon="account-group" />
|
|
|
|
</div>
|
|
|
|
<div class="media-content">
|
|
|
|
<router-link
|
|
|
|
:to="{
|
|
|
|
name: RouteName.GROUP,
|
|
|
|
params: { preferredUsername: usernameWithDomain(member.parent) },
|
|
|
|
}"
|
|
|
|
>
|
|
|
|
<h3>{{ member.parent.name }}</h3>
|
|
|
|
<p class="is-6 has-text-grey">
|
|
|
|
<span v-if="member.parent.domain">{{
|
|
|
|
`@${member.parent.preferredUsername}@${member.parent.domain}`
|
|
|
|
}}</span>
|
|
|
|
<span v-else>{{ `@${member.parent.preferredUsername}` }}</span>
|
|
|
|
<b-taglist>
|
|
|
|
<b-tag type="is-info" v-if="member.role === MemberRole.ADMINISTRATOR">{{
|
|
|
|
$t("Administrator")
|
|
|
|
}}</b-tag>
|
|
|
|
<b-tag type="is-info" v-else-if="member.role === MemberRole.MODERATOR">{{
|
|
|
|
$t("Moderator")
|
|
|
|
}}</b-tag>
|
|
|
|
</b-taglist>
|
|
|
|
</p>
|
|
|
|
</router-link>
|
|
|
|
</div>
|
2020-08-05 14:39:17 +02:00
|
|
|
</div>
|
2020-09-29 09:53:48 +02:00
|
|
|
<div class="content" v-if="member.parent.summary">
|
|
|
|
<p>{{ member.parent.summary }}</p>
|
2020-08-05 14:39:17 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-09-29 09:53:48 +02:00
|
|
|
<div>
|
|
|
|
<b-dropdown aria-role="list" position="is-bottom-left">
|
|
|
|
<b-icon icon="dots-horizontal" slot="trigger" />
|
|
|
|
|
|
|
|
<b-dropdown-item aria-role="listitem" @click="$emit('leave')">
|
|
|
|
<b-icon icon="exit-to-app" />
|
|
|
|
{{ $t("Leave") }}
|
|
|
|
</b-dropdown-item>
|
|
|
|
</b-dropdown>
|
2020-08-05 14:39:17 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Prop, Vue } from "vue-property-decorator";
|
2020-09-29 09:53:48 +02:00
|
|
|
import { IMember, MemberRole, usernameWithDomain } from "@/types/actor";
|
2020-08-05 14:39:17 +02:00
|
|
|
import RouteName from "../../router/name";
|
|
|
|
|
|
|
|
@Component
|
|
|
|
export default class GroupMemberCard extends Vue {
|
|
|
|
@Prop({ required: true }) member!: IMember;
|
|
|
|
|
|
|
|
RouteName = RouteName;
|
|
|
|
|
|
|
|
usernameWithDomain = usernameWithDomain;
|
2020-09-29 09:53:48 +02:00
|
|
|
|
|
|
|
MemberRole = MemberRole;
|
2020-08-05 14:39:17 +02:00
|
|
|
}
|
|
|
|
</script>
|
2020-09-29 09:53:48 +02:00
|
|
|
<style lang="scss" scoped>
|
|
|
|
.card-content {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
& > div:first-child {
|
|
|
|
flex: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
& > div:last-child {
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|