2019-01-21 15:08:22 +01:00
|
|
|
<template>
|
2020-11-30 10:24:11 +01:00
|
|
|
<router-link
|
2022-08-22 12:12:09 +02:00
|
|
|
class="mbz-card max-w-xs shrink-0 w-[18rem] snap-center dark:bg-mbz-purple"
|
2021-11-06 10:08:20 +01:00
|
|
|
:to="{ name: RouteName.EVENT, params: { uuid: event.uuid } }"
|
2020-11-30 10:24:11 +01:00
|
|
|
>
|
2022-08-16 13:59:37 +02:00
|
|
|
<div class="bg-secondary rounded-lg">
|
2022-07-12 10:55:28 +02:00
|
|
|
<figure class="block relative pt-40">
|
2021-06-10 09:41:07 +02:00
|
|
|
<lazy-image-wrapper
|
|
|
|
:picture="event.picture"
|
|
|
|
style="height: 100%; position: absolute; top: 0; left: 0; width: 100%"
|
|
|
|
/>
|
2020-12-01 12:33:17 +01:00
|
|
|
<div
|
2022-07-12 10:55:28 +02:00
|
|
|
class="absolute top-3 right-0 ltr:-mr-1 rtl:-ml-1 z-10 max-w-xs no-underline flex flex-col gap-1"
|
2020-12-01 12:33:17 +01:00
|
|
|
v-if="event.tags || event.status !== EventStatus.CONFIRMED"
|
|
|
|
>
|
2022-07-12 10:55:28 +02:00
|
|
|
<mobilizon-tag
|
|
|
|
variant="info"
|
|
|
|
v-if="event.status === EventStatus.TENTATIVE"
|
|
|
|
>
|
2020-12-01 12:33:17 +01:00
|
|
|
{{ $t("Tentative") }}
|
2022-07-12 10:55:28 +02:00
|
|
|
</mobilizon-tag>
|
|
|
|
<mobilizon-tag
|
|
|
|
variant="danger"
|
|
|
|
v-if="event.status === EventStatus.CANCELLED"
|
|
|
|
>
|
2020-12-01 12:33:17 +01:00
|
|
|
{{ $t("Cancelled") }}
|
2022-07-12 10:55:28 +02:00
|
|
|
</mobilizon-tag>
|
2020-07-31 17:52:26 +02:00
|
|
|
<router-link
|
|
|
|
:to="{ name: RouteName.TAG, params: { tag: tag.title } }"
|
2020-12-01 17:34:17 +01:00
|
|
|
v-for="tag in (event.tags || []).slice(0, 3)"
|
2020-07-31 17:52:26 +02:00
|
|
|
:key="tag.slug"
|
|
|
|
>
|
2022-07-12 10:55:28 +02:00
|
|
|
<mobilizon-tag dir="auto">{{ tag.title }}</mobilizon-tag>
|
2020-07-31 17:52:26 +02:00
|
|
|
</router-link>
|
2019-04-24 20:49:52 +02:00
|
|
|
</div>
|
2019-01-21 15:08:22 +01:00
|
|
|
</figure>
|
|
|
|
</div>
|
2022-08-16 13:59:37 +02:00
|
|
|
<div class="p-2">
|
2022-07-12 10:55:28 +02:00
|
|
|
<div class="relative flex flex-col h-full">
|
|
|
|
<div class="-mt-3 h-0 flex mb-3 ltr:ml-0 rtl:mr-0 items-end self-start">
|
2020-11-30 10:24:11 +01:00
|
|
|
<date-calendar-icon
|
2021-06-10 09:41:07 +02:00
|
|
|
:small="true"
|
2020-11-30 10:24:11 +01:00
|
|
|
v-if="!mergedOptions.hideDate"
|
2022-07-12 10:55:28 +02:00
|
|
|
:date="event.beginsOn.toString()"
|
2020-11-30 10:24:11 +01:00
|
|
|
/>
|
2019-01-21 15:08:22 +01:00
|
|
|
</div>
|
2022-08-12 16:46:44 +02:00
|
|
|
<div class="w-full flex flex-col justify-between">
|
2021-11-13 15:58:54 +01:00
|
|
|
<h3
|
2022-08-12 16:46:44 +02:00
|
|
|
class="text-lg leading-5 line-clamp-3 font-bold text-violet-3 dark:text-white"
|
2021-11-13 15:58:54 +01:00
|
|
|
:title="event.title"
|
|
|
|
dir="auto"
|
|
|
|
:lang="event.language"
|
|
|
|
>
|
2021-11-07 14:59:20 +01:00
|
|
|
{{ event.title }}
|
|
|
|
</h3>
|
2022-07-12 10:55:28 +02:00
|
|
|
<div class="pt-3">
|
2022-08-12 16:46:44 +02:00
|
|
|
<div
|
|
|
|
class="flex items-center text-violet-3 dark:text-white"
|
|
|
|
dir="auto"
|
|
|
|
>
|
2022-07-12 10:55:28 +02:00
|
|
|
<figure class="" v-if="actorAvatarURL">
|
2021-11-06 14:37:02 +01:00
|
|
|
<img
|
2022-07-12 10:55:28 +02:00
|
|
|
class="rounded-xl"
|
|
|
|
:src="actorAvatarURL"
|
2021-11-06 14:37:02 +01:00
|
|
|
alt=""
|
2022-07-12 10:55:28 +02:00
|
|
|
width="24"
|
|
|
|
height="24"
|
2021-11-06 14:37:02 +01:00
|
|
|
/>
|
|
|
|
</figure>
|
2022-07-12 10:55:28 +02:00
|
|
|
<account-circle v-else />
|
|
|
|
<span class="text-sm font-semibold ltr:pl-2 rtl:pr-2">
|
2021-11-06 14:37:02 +01:00
|
|
|
{{ organizerDisplayName(event) }}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<inline-address
|
|
|
|
v-if="event.physicalAddress"
|
|
|
|
:physical-address="event.physicalAddress"
|
|
|
|
/>
|
|
|
|
<div
|
2022-07-12 10:55:28 +02:00
|
|
|
class="flex items-center text-sm"
|
2021-11-07 14:59:20 +01:00
|
|
|
dir="auto"
|
2021-11-06 14:37:02 +01:00
|
|
|
v-else-if="event.options && event.options.isOnline"
|
2021-10-29 10:54:35 +02:00
|
|
|
>
|
2022-08-12 16:46:44 +02:00
|
|
|
<Video />
|
2022-07-12 10:55:28 +02:00
|
|
|
<span class="ltr:pl-2 rtl:pr-2">{{ $t("Online") }}</span>
|
2021-11-06 14:37:02 +01:00
|
|
|
</div>
|
2021-10-29 10:54:35 +02:00
|
|
|
</div>
|
2020-02-18 08:47:41 +01:00
|
|
|
</div>
|
2019-01-21 15:08:22 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-02-18 08:57:00 +01:00
|
|
|
</router-link>
|
2019-01-21 15:08:22 +01:00
|
|
|
</template>
|
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
<script lang="ts" setup>
|
2021-10-29 10:54:35 +02:00
|
|
|
import {
|
|
|
|
IEvent,
|
|
|
|
IEventCardOptions,
|
|
|
|
organizerDisplayName,
|
2022-07-12 10:55:28 +02:00
|
|
|
organizerAvatarUrl,
|
2021-10-29 10:54:35 +02:00
|
|
|
} from "@/types/event.model";
|
2020-02-18 08:57:00 +01:00
|
|
|
import DateCalendarIcon from "@/components/Event/DateCalendarIcon.vue";
|
2021-06-10 09:41:07 +02:00
|
|
|
import LazyImageWrapper from "@/components/Image/LazyImageWrapper.vue";
|
2022-07-12 10:55:28 +02:00
|
|
|
import { EventStatus } from "@/types/enums";
|
2020-07-31 17:52:26 +02: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
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
import { computed } from "vue";
|
|
|
|
import MobilizonTag from "../Tag.vue";
|
|
|
|
import AccountCircle from "vue-material-design-icons/AccountCircle.vue";
|
2022-08-12 16:46:44 +02:00
|
|
|
import Video from "vue-material-design-icons/Video.vue";
|
2022-07-12 10:55:28 +02:00
|
|
|
|
|
|
|
const props = defineProps<{ event: IEvent; options?: IEventCardOptions }>();
|
|
|
|
const defaultOptions: IEventCardOptions = {
|
|
|
|
hideDate: false,
|
|
|
|
loggedPerson: false,
|
|
|
|
hideDetails: false,
|
|
|
|
organizerActor: null,
|
|
|
|
};
|
|
|
|
|
|
|
|
const mergedOptions = computed<IEventCardOptions>(() => ({
|
|
|
|
...defaultOptions,
|
|
|
|
...props.options,
|
|
|
|
}));
|
|
|
|
|
|
|
|
// const actor = computed<Actor>(() => {
|
|
|
|
// return Object.assign(
|
|
|
|
// new Person(),
|
|
|
|
// props.event.organizerActor ?? mergedOptions.value.organizerActor
|
|
|
|
// );
|
|
|
|
// });
|
|
|
|
|
|
|
|
const actorAvatarURL = computed<string | null>(() =>
|
|
|
|
organizerAvatarUrl(props.event)
|
|
|
|
);
|
2019-01-21 15:08:22 +01:00
|
|
|
</script>
|