2020-02-18 08:57:00 +01:00
|
|
|
<template>
|
|
|
|
<router-link
|
2022-07-12 10:55:28 +02:00
|
|
|
class="block md:flex gap-x-2 gap-y-3 bg-white dark:bg-violet-2 rounded-lg shadow-md w-full"
|
2021-11-07 21:02:06 +01:00
|
|
|
dir="auto"
|
2020-02-18 08:57:00 +01:00
|
|
|
:to="{ name: RouteName.EVENT, params: { uuid: event.uuid } }"
|
|
|
|
>
|
2021-11-02 19:47:54 +01:00
|
|
|
<div class="event-preview mr-0 ml-0">
|
2022-07-12 10:55:28 +02:00
|
|
|
<div class="relative w-full">
|
|
|
|
<div class="flex absolute bottom-2 left-2 z-10 date-component">
|
|
|
|
<date-calendar-icon :date="event.beginsOn.toString()" :small="true" />
|
2021-11-02 19:47:54 +01:00
|
|
|
</div>
|
|
|
|
<lazy-image-wrapper
|
|
|
|
:picture="event.picture"
|
|
|
|
:rounded="true"
|
2022-07-12 10:55:28 +02:00
|
|
|
class="object-cover flex-none h-32 md:w-48 rounded-t-lg md:rounded-none md:rounded-l-lg"
|
2021-11-02 19:47:54 +01:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-07-12 10:55:28 +02:00
|
|
|
<div class="title-info-wrapper p-2">
|
|
|
|
<h3
|
|
|
|
class="event-minimalist-title pb-2 text-lg leading-6 line-clamp-3 font-bold text-violet-title dark:text-white"
|
|
|
|
:lang="event.language"
|
|
|
|
dir="auto"
|
|
|
|
>
|
2021-11-26 14:46:25 +01:00
|
|
|
<b-tag
|
2022-07-12 10:55:28 +02:00
|
|
|
variant="info"
|
2021-11-26 14:46:25 +01:00
|
|
|
class="mr-1"
|
|
|
|
v-if="event.status === EventStatus.TENTATIVE"
|
|
|
|
>
|
|
|
|
{{ $t("Tentative") }}
|
|
|
|
</b-tag>
|
|
|
|
<b-tag
|
2022-07-12 10:55:28 +02:00
|
|
|
variant="danger"
|
2021-11-26 14:46:25 +01:00
|
|
|
class="mr-1"
|
|
|
|
v-if="event.status === EventStatus.CANCELLED"
|
|
|
|
>
|
|
|
|
{{ $t("Cancelled") }}
|
|
|
|
</b-tag>
|
2021-11-02 19:47:54 +01:00
|
|
|
<b-tag
|
|
|
|
class="mr-2"
|
2022-07-12 10:55:28 +02:00
|
|
|
variant="warning"
|
2021-11-02 19:47:54 +01:00
|
|
|
size="is-medium"
|
|
|
|
v-if="event.draft"
|
|
|
|
>{{ $t("Draft") }}</b-tag
|
|
|
|
>
|
|
|
|
{{ event.title }}
|
|
|
|
</h3>
|
2021-11-06 11:15:16 +01:00
|
|
|
<inline-address
|
2021-11-02 19:47:54 +01:00
|
|
|
v-if="event.physicalAddress"
|
|
|
|
class="event-subtitle"
|
|
|
|
:physical-address="event.physicalAddress"
|
|
|
|
/>
|
|
|
|
<div
|
|
|
|
class="event-subtitle"
|
|
|
|
v-else-if="event.options && event.options.isOnline"
|
|
|
|
>
|
2022-07-12 10:55:28 +02:00
|
|
|
<Video />
|
2021-11-02 19:47:54 +01:00
|
|
|
<span>{{ $t("Online") }}</span>
|
|
|
|
</div>
|
2022-07-12 10:55:28 +02:00
|
|
|
<div class="event-subtitle event-organizer flex" v-if="showOrganizer">
|
2021-11-02 19:47:54 +01:00
|
|
|
<figure
|
|
|
|
class="image is-24x24"
|
2022-07-12 10:55:28 +02:00
|
|
|
v-if="organizer(event) && organizer(event)?.avatar"
|
2021-11-02 19:47:54 +01:00
|
|
|
>
|
2022-07-12 10:55:28 +02:00
|
|
|
<img class="is-rounded" :src="organizer(event)?.avatar?.url" alt="" />
|
2021-11-02 19:47:54 +01:00
|
|
|
</figure>
|
2022-07-12 10:55:28 +02:00
|
|
|
<AccountCircle v-else />
|
2021-11-02 19:47:54 +01:00
|
|
|
<span class="organizer-name">
|
|
|
|
{{ organizerDisplayName(event) }}
|
|
|
|
</span>
|
|
|
|
</div>
|
2022-07-12 10:55:28 +02:00
|
|
|
<p class="flex gap-1">
|
|
|
|
<AccountMultiple />
|
2020-09-02 17:42:17 +02:00
|
|
|
<span v-if="event.options.maximumAttendeeCapacity !== 0">
|
|
|
|
{{
|
2022-07-12 10:55:28 +02:00
|
|
|
$t(
|
2020-09-02 17:42:17 +02:00
|
|
|
"{available}/{capacity} available places",
|
|
|
|
{
|
|
|
|
available:
|
2020-11-30 10:24:11 +01:00
|
|
|
event.options.maximumAttendeeCapacity -
|
|
|
|
event.participantStats.participant,
|
2020-09-02 17:42:17 +02:00
|
|
|
capacity: event.options.maximumAttendeeCapacity,
|
2022-07-12 10:55:28 +02:00
|
|
|
},
|
|
|
|
event.options.maximumAttendeeCapacity -
|
|
|
|
event.participantStats.participant
|
2020-09-02 17:42:17 +02:00
|
|
|
)
|
|
|
|
}}
|
|
|
|
</span>
|
|
|
|
<span v-else>
|
|
|
|
{{
|
2022-07-12 10:55:28 +02:00
|
|
|
$t(
|
|
|
|
"{count} participants",
|
|
|
|
{
|
|
|
|
count: event.participantStats.participant,
|
|
|
|
},
|
|
|
|
event.participantStats.participant
|
|
|
|
)
|
2020-09-02 17:42:17 +02:00
|
|
|
}}
|
|
|
|
</span>
|
|
|
|
<span v-if="event.participantStats.notApproved > 0">
|
2022-07-12 10:55:28 +02:00
|
|
|
<o-button
|
2020-09-02 17:42:17 +02:00
|
|
|
type="is-text"
|
|
|
|
@click="
|
|
|
|
gotToWithCheck(participation, {
|
|
|
|
name: RouteName.PARTICIPATIONS,
|
|
|
|
query: { role: ParticipantRole.NOT_APPROVED },
|
|
|
|
params: { eventId: event.uuid },
|
|
|
|
})
|
|
|
|
"
|
|
|
|
>
|
|
|
|
{{
|
2022-07-12 10:55:28 +02:00
|
|
|
$t(
|
2020-11-30 10:24:11 +01:00
|
|
|
"{count} requests waiting",
|
2022-07-12 10:55:28 +02:00
|
|
|
|
2020-11-30 10:24:11 +01:00
|
|
|
{
|
|
|
|
count: event.participantStats.notApproved,
|
2022-07-12 10:55:28 +02:00
|
|
|
},
|
|
|
|
event.participantStats.notApproved
|
2020-11-30 10:24:11 +01:00
|
|
|
)
|
2020-09-02 17:42:17 +02:00
|
|
|
}}
|
2022-07-12 10:55:28 +02:00
|
|
|
</o-button>
|
2020-09-02 17:42:17 +02:00
|
|
|
</span>
|
|
|
|
</p>
|
2020-02-18 08:57:00 +01:00
|
|
|
</div>
|
|
|
|
</router-link>
|
|
|
|
</template>
|
2022-07-12 10:55:28 +02:00
|
|
|
<script lang="ts" setup>
|
2021-11-02 19:47:54 +01:00
|
|
|
import { IEvent, organizer, organizerDisplayName } from "@/types/event.model";
|
2020-02-18 08:57:00 +01:00
|
|
|
import DateCalendarIcon from "@/components/Event/DateCalendarIcon.vue";
|
2021-11-26 14:46:25 +01:00
|
|
|
import { EventStatus, ParticipantRole } from "@/types/enums";
|
2020-02-18 08:57:00 +01:00
|
|
|
import RouteName from "../../router/name";
|
2021-11-02 19:47:54 +01:00
|
|
|
import LazyImageWrapper from "@/components/Image/LazyImageWrapper.vue";
|
2021-11-06 11:15:16 +01:00
|
|
|
import InlineAddress from "@/components/Address/InlineAddress.vue";
|
2022-07-12 10:55:28 +02:00
|
|
|
import Video from "vue-material-design-icons/Video.vue";
|
|
|
|
import AccountCircle from "vue-material-design-icons/AccountCircle.vue";
|
|
|
|
import AccountMultiple from "vue-material-design-icons/AccountMultiple.vue";
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
withDefaults(
|
|
|
|
defineProps<{
|
|
|
|
event: IEvent;
|
|
|
|
showOrganizer?: boolean;
|
|
|
|
}>(),
|
|
|
|
{ showOrganizer: false }
|
|
|
|
);
|
2020-02-18 08:57:00 +01:00
|
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
2021-11-04 18:14:36 +01:00
|
|
|
@use "@/styles/_mixins" as *;
|
2022-07-12 10:55:28 +02:00
|
|
|
// @import "node_modules/bulma/sass/utilities/mixins.sass";
|
|
|
|
// @import "@/variables.scss";
|
2021-11-02 19:47:54 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
.event-minimalist-card-wrapper {
|
2022-07-12 10:55:28 +02:00
|
|
|
// display: grid;
|
|
|
|
// grid-gap: 5px 10px;
|
2021-11-02 19:47:54 +01:00
|
|
|
grid-template-areas: "preview" "body";
|
2022-07-12 10:55:28 +02:00
|
|
|
// color: initial;
|
2021-11-02 19:47:54 +01:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
// @include desktop {
|
|
|
|
grid-template-columns: 200px 3fr;
|
|
|
|
grid-template-areas: "preview body";
|
|
|
|
// }
|
2021-11-02 19:47:54 +01:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
// .event-preview {
|
|
|
|
// & > div {
|
|
|
|
// position: relative;
|
|
|
|
// height: 120px;
|
|
|
|
// width: 100%;
|
2021-11-02 19:47:54 +01:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
// div.date-component {
|
|
|
|
// display: flex;
|
|
|
|
// position: absolute;
|
|
|
|
// bottom: 5px;
|
|
|
|
// left: 5px;
|
|
|
|
// z-index: 1;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
// .calendar-icon {
|
|
|
|
// @include margin-right(1rem);
|
|
|
|
// }
|
2020-02-18 08:57:00 +01:00
|
|
|
|
|
|
|
.title-info-wrapper {
|
|
|
|
flex: 2;
|
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
// .event-minimalist-title {
|
|
|
|
// padding-bottom: 5px;
|
|
|
|
// font-size: 18px;
|
|
|
|
// line-height: 24px;
|
|
|
|
// display: -webkit-box;
|
|
|
|
// -webkit-line-clamp: 3;
|
|
|
|
// -webkit-box-orient: vertical;
|
|
|
|
// overflow: hidden;
|
|
|
|
// font-weight: bold;
|
|
|
|
// color: $title-color;
|
|
|
|
// }
|
2021-11-02 19:47:54 +01:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
:deep(.icon) {
|
2021-11-02 19:47:54 +01:00
|
|
|
vertical-align: middle;
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|