2020-08-05 14:39:17 +02:00
|
|
|
<template>
|
|
|
|
<div class="card">
|
2020-12-01 16:14:53 +01:00
|
|
|
<div class="identity-header">
|
|
|
|
<figure class="image is-24x24" v-if="member.actor.avatar">
|
|
|
|
<img class="is-rounded" :src="member.actor.avatar.url" alt="" />
|
|
|
|
</figure>
|
|
|
|
{{ displayNameAndUsername(member.actor) }}
|
|
|
|
</div>
|
2020-08-05 14:39:17 +02:00
|
|
|
<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,
|
2020-11-30 10:24:11 +01:00
|
|
|
params: {
|
|
|
|
preferredUsername: usernameWithDomain(member.parent),
|
|
|
|
},
|
2020-09-29 09:53:48 +02:00
|
|
|
}"
|
|
|
|
>
|
2021-09-07 17:52:34 +02:00
|
|
|
<h2>{{ member.parent.name }}</h2>
|
|
|
|
<p class="is-6 has-text-grey-dark">
|
2020-09-29 09:53:48 +02:00
|
|
|
<span v-if="member.parent.domain">{{
|
|
|
|
`@${member.parent.preferredUsername}@${member.parent.domain}`
|
|
|
|
}}</span>
|
|
|
|
<span v-else>{{ `@${member.parent.preferredUsername}` }}</span>
|
|
|
|
<b-taglist>
|
2020-11-30 10:24:11 +01:00
|
|
|
<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
|
|
|
|
>
|
2020-09-29 09:53:48 +02:00
|
|
|
</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-12-01 16:14:53 +01:00
|
|
|
import { displayNameAndUsername, usernameWithDomain } from "@/types/actor";
|
2020-11-27 19:27:44 +01:00
|
|
|
import { IMember } from "@/types/actor/member.model";
|
|
|
|
import { MemberRole } from "@/types/enums";
|
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
|
|
|
|
2020-12-01 16:14:53 +01:00
|
|
|
displayNameAndUsername = displayNameAndUsername;
|
|
|
|
|
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>
|
2020-12-01 16:14:53 +01:00
|
|
|
.card {
|
|
|
|
.card-content {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2020-09-29 09:53:48 +02:00
|
|
|
|
2020-12-01 16:14:53 +01:00
|
|
|
& > div:first-child {
|
|
|
|
flex: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
& > div:last-child {
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
2021-06-11 18:31:24 +02:00
|
|
|
|
|
|
|
.media-content {
|
2021-06-14 16:39:04 +02:00
|
|
|
::v-deep .tags {
|
|
|
|
margin-bottom: 0;
|
|
|
|
}
|
2021-06-11 18:31:24 +02:00
|
|
|
}
|
2020-09-29 09:53:48 +02:00
|
|
|
}
|
|
|
|
|
2020-12-01 16:14:53 +01:00
|
|
|
.identity-header {
|
|
|
|
background: $yellow-2;
|
|
|
|
display: flex;
|
|
|
|
padding: 5px;
|
|
|
|
|
|
|
|
figure {
|
|
|
|
padding-right: 3px;
|
|
|
|
}
|
2020-09-29 09:53:48 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|