2019-12-20 13:04:34 +01:00
|
|
|
<template>
|
2022-07-12 10:55:28 +02:00
|
|
|
<article
|
|
|
|
class="bg-white dark:bg-gray-700 dark:text-white dark:hover:text-white rounded-lg shadow-md max-w-3xl p-2"
|
|
|
|
>
|
|
|
|
<div class="flex gap-2">
|
|
|
|
<div class="">
|
|
|
|
<date-calendar-icon :date="event.beginsOn.toString()" :small="true" />
|
2019-12-20 13:04:34 +01:00
|
|
|
</div>
|
2022-07-12 10:55:28 +02:00
|
|
|
<router-link
|
|
|
|
:to="{ name: RouteName.EVENT, params: { uuid: event.uuid } }"
|
|
|
|
>
|
|
|
|
<h2 class="text-2xl line-clamp-2">{{ event.title }}</h2>
|
|
|
|
</router-link>
|
|
|
|
</div>
|
|
|
|
<div class="">
|
|
|
|
<span v-if="event.physicalAddress && event.physicalAddress.locality">
|
|
|
|
{{ event.physicalAddress.locality }}
|
|
|
|
</span>
|
|
|
|
<span v-if="event.attributedTo">
|
|
|
|
{{
|
|
|
|
$t("Created by {name}", {
|
|
|
|
name: displayName(event.attributedTo),
|
|
|
|
})
|
|
|
|
}}
|
|
|
|
</span>
|
|
|
|
<span v-else>
|
|
|
|
{{
|
|
|
|
$t("Organized by {name}", {
|
|
|
|
name: displayName(event.organizerActor),
|
|
|
|
})
|
|
|
|
}}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class="flex gap-1">
|
|
|
|
<span>
|
|
|
|
<Earth v-if="event.visibility === EventVisibility.PUBLIC" />
|
|
|
|
<Link v-if="event.visibility === EventVisibility.UNLISTED" />
|
|
|
|
<Lock v-if="event.visibility === EventVisibility.PRIVATE" />
|
|
|
|
</span>
|
|
|
|
<span>
|
|
|
|
<span v-if="event.options.maximumAttendeeCapacity !== 0">
|
|
|
|
{{
|
|
|
|
$t("{approved} / {total} seats", {
|
|
|
|
approved: event.participantStats.participant,
|
|
|
|
total: event.options.maximumAttendeeCapacity,
|
|
|
|
})
|
|
|
|
}}
|
|
|
|
</span>
|
|
|
|
<span v-else>
|
|
|
|
{{
|
|
|
|
$t(
|
|
|
|
"{count} participants",
|
|
|
|
{
|
|
|
|
count: event.participantStats.participant,
|
|
|
|
},
|
|
|
|
event.participantStats.participant
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
</span>
|
|
|
|
</span>
|
2019-12-20 13:04:34 +01:00
|
|
|
</div>
|
2020-02-18 08:57:00 +01:00
|
|
|
</article>
|
2019-12-20 13:04:34 +01:00
|
|
|
</template>
|
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
<script lang="ts" setup>
|
2020-11-27 19:27:44 +01:00
|
|
|
import { IEventCardOptions, IEvent } from "@/types/event.model";
|
2020-02-18 08:57:00 +01:00
|
|
|
import DateCalendarIcon from "@/components/Event/DateCalendarIcon.vue";
|
2022-07-12 10:55:28 +02:00
|
|
|
import { displayName } from "@/types/actor";
|
|
|
|
import { EventVisibility } from "@/types/enums";
|
2020-02-18 08:57:00 +01:00
|
|
|
import RouteName from "../../router/name";
|
2022-07-12 10:55:28 +02:00
|
|
|
import Earth from "vue-material-design-icons/Earth.vue";
|
|
|
|
import Link from "vue-material-design-icons/Link.vue";
|
|
|
|
import Lock from "vue-material-design-icons/Lock.vue";
|
2019-12-20 13:04:34 +01:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
withDefaults(defineProps<{ event: IEvent; options?: IEventCardOptions }>(), {
|
|
|
|
options: (): IEventCardOptions => ({
|
|
|
|
hideDate: true,
|
|
|
|
loggedPerson: false,
|
|
|
|
hideDetails: false,
|
|
|
|
organizerActor: null,
|
|
|
|
}),
|
|
|
|
});
|
2019-12-20 13:04:34 +01:00
|
|
|
</script>
|