2019-01-21 15:08:22 +01:00
|
|
|
<template>
|
2021-11-06 10:08:20 +01:00
|
|
|
<router-link
|
|
|
|
:to="{
|
|
|
|
name: RouteName.GROUP,
|
|
|
|
params: { preferredUsername: usernameWithDomain(group) },
|
|
|
|
}"
|
|
|
|
class="card"
|
|
|
|
>
|
|
|
|
<div class="card-image">
|
|
|
|
<figure class="image is-16by9">
|
|
|
|
<lazy-image-wrapper
|
|
|
|
:picture="group.banner"
|
|
|
|
style="height: 100%; position: absolute; top: 0; left: 0; width: 100%"
|
|
|
|
/>
|
|
|
|
</figure>
|
|
|
|
</div>
|
2019-01-21 15:08:22 +01:00
|
|
|
<div class="card-content">
|
2021-11-06 14:37:02 +01:00
|
|
|
<div class="media mb-2">
|
2020-02-18 08:57:00 +01:00
|
|
|
<div class="media-left">
|
2020-10-10 17:13:59 +02:00
|
|
|
<figure class="image is-48x48" v-if="group.avatar">
|
|
|
|
<img class="is-rounded" :src="group.avatar.url" alt="" />
|
2020-02-18 08:57:00 +01:00
|
|
|
</figure>
|
2020-10-10 17:13:59 +02:00
|
|
|
<b-icon v-else size="is-large" icon="account-group" />
|
2020-02-18 08:57:00 +01:00
|
|
|
</div>
|
|
|
|
<div class="media-content">
|
2021-11-07 14:59:20 +01:00
|
|
|
<h3 class="is-size-5 group-title" dir="auto">
|
|
|
|
{{ displayName(group) }}
|
|
|
|
</h3>
|
2021-11-06 14:37:02 +01:00
|
|
|
<span class="is-6 has-text-grey-dark group-federated-username">
|
2021-11-06 10:08:20 +01:00
|
|
|
{{ `@${usernameWithDomain(group)}` }}
|
|
|
|
</span>
|
2020-02-18 08:57:00 +01:00
|
|
|
</div>
|
2019-01-21 15:08:22 +01:00
|
|
|
</div>
|
2022-03-24 14:41:49 +01:00
|
|
|
<div
|
|
|
|
class="content mb-2 line-clamp-3"
|
|
|
|
dir="auto"
|
|
|
|
v-html="group.summary"
|
|
|
|
/>
|
|
|
|
<div>
|
2021-11-06 11:15:16 +01:00
|
|
|
<inline-address
|
|
|
|
class="has-text-grey-dark"
|
|
|
|
v-if="group.physicalAddress"
|
|
|
|
:physicalAddress="group.physicalAddress"
|
|
|
|
/>
|
|
|
|
<p class="has-text-grey-dark">
|
2021-11-06 14:37:02 +01:00
|
|
|
<b-icon icon="account" />
|
2021-11-06 10:08:20 +01:00
|
|
|
{{
|
|
|
|
$tc(
|
|
|
|
"{count} members or followers",
|
|
|
|
group.members.total + group.followers.total,
|
|
|
|
{
|
|
|
|
count: group.members.total + group.followers.total,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}}
|
2021-11-06 11:15:16 +01:00
|
|
|
</p>
|
2019-01-21 15:08:22 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-11-06 10:08:20 +01:00
|
|
|
</router-link>
|
2019-01-21 15:08:22 +01:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-02-18 08:57:00 +01:00
|
|
|
import { Component, Prop, Vue } from "vue-property-decorator";
|
2021-11-06 10:08:20 +01:00
|
|
|
import { displayName, IGroup, usernameWithDomain } from "@/types/actor";
|
|
|
|
import LazyImageWrapper from "@/components/Image/LazyImageWrapper.vue";
|
2020-02-18 08:57:00 +01:00
|
|
|
import RouteName from "../../router/name";
|
2021-11-06 11:15:16 +01:00
|
|
|
import InlineAddress from "@/components/Address/InlineAddress.vue";
|
2019-01-21 15:08:22 +01:00
|
|
|
|
2021-11-06 10:08:20 +01:00
|
|
|
@Component({
|
|
|
|
components: {
|
|
|
|
LazyImageWrapper,
|
2021-11-06 11:15:16 +01:00
|
|
|
InlineAddress,
|
2021-11-06 10:08:20 +01:00
|
|
|
},
|
|
|
|
})
|
2019-01-21 15:08:22 +01:00
|
|
|
export default class GroupCard extends Vue {
|
2020-08-05 14:39:17 +02:00
|
|
|
@Prop({ required: true }) group!: IGroup;
|
2019-04-03 17:29:03 +02:00
|
|
|
|
|
|
|
RouteName = RouteName;
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2020-08-05 14:39:17 +02:00
|
|
|
usernameWithDomain = usernameWithDomain;
|
2021-11-06 10:08:20 +01:00
|
|
|
|
|
|
|
displayName = displayName;
|
2019-01-21 15:08:22 +01:00
|
|
|
}
|
|
|
|
</script>
|
2021-11-06 10:08:20 +01:00
|
|
|
<style lang="scss" scoped>
|
|
|
|
.card {
|
|
|
|
.card-content {
|
|
|
|
padding: 0.75rem;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
.content {
|
|
|
|
flex: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
::v-deep .content {
|
|
|
|
& > *:first-child {
|
|
|
|
display: -webkit-box;
|
|
|
|
-webkit-line-clamp: 3;
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
overflow: hidden;
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
|
|
|
* {
|
|
|
|
font-weight: normal;
|
|
|
|
text-transform: none;
|
|
|
|
font-style: normal;
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
& > *:not(:first-child) {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.media-left {
|
|
|
|
margin-right: inherit;
|
|
|
|
margin-inline-end: 0.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.media-content {
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
|
|
.group-title {
|
2021-11-06 14:37:02 +01:00
|
|
|
line-height: 1.5rem;
|
2021-11-06 10:08:20 +01:00
|
|
|
display: -webkit-box;
|
|
|
|
-webkit-line-clamp: 3;
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
overflow: hidden;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
2021-11-06 14:37:02 +01:00
|
|
|
.group-federated-username {
|
|
|
|
font-size: 14px;
|
|
|
|
}
|
2021-11-06 10:08:20 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|