2020-02-18 08:57:00 +01:00
|
|
|
<template>
|
2021-11-12 15:42:52 +01:00
|
|
|
<div class="card">
|
|
|
|
<div class="card-content media">
|
|
|
|
<div class="media-content">
|
|
|
|
<div class="content">
|
|
|
|
<i18n
|
|
|
|
tag="p"
|
|
|
|
path="You have been invited by {invitedBy} to the following group:"
|
|
|
|
>
|
|
|
|
<b slot="invitedBy">{{ member.invitedBy.name }}</b>
|
|
|
|
</i18n>
|
2020-02-18 08:57:00 +01:00
|
|
|
</div>
|
2021-11-12 15:42:52 +01:00
|
|
|
<div class="media subfield">
|
|
|
|
<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">
|
|
|
|
<div class="level">
|
|
|
|
<div class="level-left">
|
|
|
|
<div class="level-item mr-3">
|
|
|
|
<router-link
|
|
|
|
:to="{
|
|
|
|
name: RouteName.GROUP,
|
|
|
|
params: {
|
|
|
|
preferredUsername: usernameWithDomain(member.parent),
|
|
|
|
},
|
|
|
|
}"
|
|
|
|
>
|
|
|
|
<h3 class="is-size-5">{{ member.parent.name }}</h3>
|
|
|
|
<p class="is-size-7 has-text-grey-dark">
|
|
|
|
<span v-if="member.parent.domain">
|
|
|
|
{{
|
|
|
|
`@${member.parent.preferredUsername}@${member.parent.domain}`
|
|
|
|
}}
|
|
|
|
</span>
|
|
|
|
<span v-else>{{
|
|
|
|
`@${member.parent.preferredUsername}`
|
|
|
|
}}</span>
|
|
|
|
</p>
|
|
|
|
</router-link>
|
|
|
|
</div>
|
2020-02-18 08:57:00 +01:00
|
|
|
</div>
|
2021-11-12 15:42:52 +01:00
|
|
|
<div class="level-right">
|
|
|
|
<div class="level-item">
|
|
|
|
<b-button
|
|
|
|
type="is-success"
|
|
|
|
@click="$emit('accept', member.id)"
|
|
|
|
>
|
|
|
|
{{ $t("Accept") }}
|
|
|
|
</b-button>
|
|
|
|
</div>
|
|
|
|
<div class="level-item">
|
|
|
|
<b-button
|
|
|
|
type="is-danger"
|
|
|
|
@click="$emit('reject', member.id)"
|
|
|
|
>
|
|
|
|
{{ $t("Decline") }}
|
|
|
|
</b-button>
|
|
|
|
</div>
|
2020-02-18 08:57:00 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Prop, Vue } from "vue-property-decorator";
|
2020-11-27 19:27:44 +01:00
|
|
|
import { usernameWithDomain } from "@/types/actor";
|
|
|
|
import { IMember } from "@/types/actor/member.model";
|
2020-02-18 08:57:00 +01:00
|
|
|
import RouteName from "../../router/name";
|
|
|
|
|
|
|
|
@Component
|
|
|
|
export default class InvitationCard extends Vue {
|
|
|
|
@Prop({ required: true }) member!: IMember;
|
|
|
|
|
|
|
|
RouteName = RouteName;
|
2020-07-09 17:24:28 +02:00
|
|
|
|
|
|
|
usernameWithDomain = usernameWithDomain;
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.media:not(.subfield) {
|
|
|
|
background: lighten($primary, 40%);
|
|
|
|
padding: 10px;
|
|
|
|
}
|
2021-11-12 15:42:52 +01:00
|
|
|
h3 {
|
|
|
|
color: $violet-3;
|
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
</style>
|