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 10:08:20 +01:00
|
|
|
<div class="media mb-3">
|
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-06 10:08:20 +01:00
|
|
|
<h3 class="is-size-5 group-title">{{ displayName(group) }}</h3>
|
|
|
|
<span class="is-6 has-text-grey-dark">
|
|
|
|
{{ `@${usernameWithDomain(group)}` }}
|
|
|
|
</span>
|
2020-02-18 08:57:00 +01:00
|
|
|
</div>
|
2019-01-21 15:08:22 +01:00
|
|
|
</div>
|
2021-11-06 10:08:20 +01:00
|
|
|
<div class="content" v-html="group.summary" />
|
|
|
|
<div class="card-custom-footer">
|
|
|
|
<span class="has-text-grey-dark">
|
|
|
|
{{
|
|
|
|
$tc(
|
|
|
|
"{count} members or followers",
|
|
|
|
group.members.total + group.followers.total,
|
|
|
|
{
|
|
|
|
count: group.members.total + group.followers.total,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
</span>
|
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";
|
2019-01-21 15:08:22 +01:00
|
|
|
|
2021-11-06 10:08:20 +01:00
|
|
|
@Component({
|
|
|
|
components: {
|
|
|
|
LazyImageWrapper,
|
|
|
|
},
|
|
|
|
})
|
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 {
|
|
|
|
line-height: 1.75rem;
|
|
|
|
display: -webkit-box;
|
|
|
|
-webkit-line-clamp: 3;
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
overflow: hidden;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|