2019-09-18 15:32:37 +00:00
|
|
|
<template>
|
2022-07-12 08:55:28 +00:00
|
|
|
<article class="bg-white dark:bg-mbz-purple mb-5 mt-4 p-0">
|
|
|
|
<div
|
|
|
|
class="bg-mbz-yellow-2 flex p-2 text-violet-title rounded-t-lg"
|
|
|
|
dir="auto"
|
|
|
|
>
|
|
|
|
<figure
|
|
|
|
class="image is-24x24 ltr:pr-1 rtl:pl-1"
|
|
|
|
v-if="participation.actor.avatar"
|
|
|
|
>
|
2021-06-18 17:25:47 +00:00
|
|
|
<img
|
|
|
|
class="is-rounded"
|
|
|
|
:src="participation.actor.avatar.url"
|
|
|
|
alt=""
|
|
|
|
height="24"
|
|
|
|
width="24"
|
|
|
|
/>
|
2020-12-01 16:32:07 +00:00
|
|
|
</figure>
|
2022-07-12 08:55:28 +00:00
|
|
|
<AccountCircle class="ltr:pr-1 rtl:pl-1" v-else />
|
2020-12-01 16:32:07 +00:00
|
|
|
{{ displayNameAndUsername(participation.actor) }}
|
|
|
|
</div>
|
2022-07-12 08:55:28 +00:00
|
|
|
<div class="list-card flex flex-col relative">
|
|
|
|
<div
|
2022-08-12 14:46:44 +00:00
|
|
|
class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-x-1.5 gapt-x-3 pb-2"
|
2022-07-12 08:55:28 +00:00
|
|
|
>
|
|
|
|
<div class="mr-0 ml-0">
|
|
|
|
<div class="h-36 relative w-full">
|
|
|
|
<div class="flex absolute bottom-2 left-2 z-10">
|
2021-11-02 18:47:54 +00:00
|
|
|
<date-calendar-icon
|
2022-07-12 08:55:28 +00:00
|
|
|
:date="participation.event.beginsOn.toString()"
|
2021-11-02 18:47:54 +00:00
|
|
|
:small="true"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<router-link
|
2022-07-12 08:55:28 +00:00
|
|
|
class="h-full"
|
2021-11-02 18:47:54 +00:00
|
|
|
:to="{
|
|
|
|
name: RouteName.EVENT,
|
|
|
|
params: { uuid: participation.event.uuid },
|
|
|
|
}"
|
|
|
|
>
|
|
|
|
<lazy-image-wrapper
|
|
|
|
:rounded="true"
|
|
|
|
:picture="participation.event.picture"
|
|
|
|
style="
|
|
|
|
height: 100%;
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
"
|
|
|
|
/>
|
|
|
|
</router-link>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-07-12 08:55:28 +00:00
|
|
|
<div class="list-card-content lg:col-span-2 flex-1 p-2">
|
|
|
|
<div class="flex items-center pt-2" dir="auto">
|
2021-11-26 13:46:25 +00:00
|
|
|
<b-tag
|
2022-07-12 08:55:28 +00:00
|
|
|
variant="info"
|
2021-11-26 13:46:25 +00:00
|
|
|
class="mr-1 mb-1"
|
|
|
|
size="is-medium"
|
|
|
|
v-if="participation.event.status === EventStatus.TENTATIVE"
|
|
|
|
>
|
|
|
|
{{ $t("Tentative") }}
|
|
|
|
</b-tag>
|
|
|
|
<b-tag
|
2022-07-12 08:55:28 +00:00
|
|
|
variant="danger"
|
2021-11-26 13:46:25 +00:00
|
|
|
class="mr-1 mb-1"
|
|
|
|
size="is-medium"
|
|
|
|
v-if="participation.event.status === EventStatus.CANCELLED"
|
|
|
|
>
|
|
|
|
{{ $t("Cancelled") }}
|
|
|
|
</b-tag>
|
2021-06-11 16:31:24 +00:00
|
|
|
<router-link
|
|
|
|
:to="{
|
|
|
|
name: RouteName.EVENT,
|
|
|
|
params: { uuid: participation.event.uuid },
|
|
|
|
}"
|
|
|
|
>
|
2022-07-12 08:55:28 +00:00
|
|
|
<h3
|
|
|
|
class="line-clamp-3 font-bold mx-auto my-0 text-lg text-violet-title dark:text-white"
|
|
|
|
:lang="participation.event.language"
|
|
|
|
>
|
2021-11-13 14:58:54 +00:00
|
|
|
{{ participation.event.title }}
|
|
|
|
</h3>
|
2021-06-11 16:31:24 +00:00
|
|
|
</router-link>
|
|
|
|
</div>
|
2021-11-06 10:15:16 +00:00
|
|
|
<inline-address
|
2021-11-02 18:47:54 +00:00
|
|
|
v-if="participation.event.physicalAddress"
|
|
|
|
:physical-address="participation.event.physicalAddress"
|
|
|
|
/>
|
|
|
|
<div
|
2022-08-12 14:46:44 +00:00
|
|
|
class="flex gap-1"
|
2021-11-02 18:47:54 +00:00
|
|
|
v-else-if="
|
|
|
|
participation.event.options &&
|
|
|
|
participation.event.options.isOnline
|
|
|
|
"
|
|
|
|
>
|
2022-07-12 08:55:28 +00:00
|
|
|
<Video />
|
2021-11-02 18:47:54 +00:00
|
|
|
<span>{{ $t("Online") }}</span>
|
|
|
|
</div>
|
2022-07-12 08:55:28 +00:00
|
|
|
<div class="flex gap-1">
|
|
|
|
<figure class="" v-if="actorAvatarURL">
|
2021-11-02 18:47:54 +00:00
|
|
|
<img
|
2022-07-12 08:55:28 +00:00
|
|
|
class="rounded"
|
|
|
|
:src="actorAvatarURL"
|
2021-11-02 18:47:54 +00:00
|
|
|
alt=""
|
2022-07-12 08:55:28 +00:00
|
|
|
width="24"
|
|
|
|
height="24"
|
2021-11-02 18:47:54 +00:00
|
|
|
/>
|
|
|
|
</figure>
|
2022-07-12 08:55:28 +00:00
|
|
|
<AccountCircle v-else />
|
|
|
|
<span>
|
2021-11-02 18:47:54 +00:00
|
|
|
{{ organizerDisplayName(participation.event) }}
|
|
|
|
</span>
|
2021-06-11 16:31:24 +00:00
|
|
|
</div>
|
2022-07-12 08:55:28 +00:00
|
|
|
<div class="flex">
|
|
|
|
<AccountGroup :class="{ 'has-text-danger': lastSeatsLeft }" />
|
2020-11-30 09:24:11 +00:00
|
|
|
<span
|
2022-07-12 08:55:28 +00:00
|
|
|
class="flex items-center py-0 px-2"
|
2021-11-02 18:47:54 +00:00
|
|
|
v-if="participation.role !== ParticipantRole.NOT_APPROVED"
|
2020-11-30 09:24:11 +00:00
|
|
|
>
|
2021-11-02 18:47:54 +00:00
|
|
|
<!-- Less than 10 seats left -->
|
|
|
|
<span class="has-text-danger" v-if="lastSeatsLeft">
|
|
|
|
{{
|
|
|
|
$t("{number} seats left", {
|
|
|
|
number: seatsLeft,
|
|
|
|
})
|
|
|
|
}}
|
|
|
|
</span>
|
2021-06-11 16:31:24 +00:00
|
|
|
<span
|
2021-11-02 18:47:54 +00:00
|
|
|
v-else-if="
|
|
|
|
participation.event.options.maximumAttendeeCapacity !== 0
|
|
|
|
"
|
2020-02-18 07:57:00 +00:00
|
|
|
>
|
|
|
|
{{
|
2022-07-12 08:55:28 +00:00
|
|
|
$t(
|
2021-06-11 16:31:24 +00:00
|
|
|
"{available}/{capacity} available places",
|
|
|
|
{
|
|
|
|
available:
|
|
|
|
participation.event.options.maximumAttendeeCapacity -
|
|
|
|
participation.event.participantStats.participant,
|
|
|
|
capacity:
|
|
|
|
participation.event.options.maximumAttendeeCapacity,
|
2022-07-12 08:55:28 +00:00
|
|
|
},
|
|
|
|
participation.event.options.maximumAttendeeCapacity -
|
|
|
|
participation.event.participantStats.participant
|
2021-06-11 16:31:24 +00:00
|
|
|
)
|
|
|
|
}}
|
|
|
|
</span>
|
|
|
|
<span v-else>
|
|
|
|
{{
|
2022-07-12 08:55:28 +00:00
|
|
|
$t(
|
2021-06-11 16:31:24 +00:00
|
|
|
"{count} participants",
|
2021-06-10 08:33:16 +00:00
|
|
|
{
|
2021-06-11 16:31:24 +00:00
|
|
|
count: participation.event.participantStats.participant,
|
2022-07-12 08:55:28 +00:00
|
|
|
},
|
|
|
|
participation.event.participantStats.participant
|
2020-02-18 07:57:00 +00:00
|
|
|
)
|
|
|
|
}}
|
2021-06-11 16:31:24 +00:00
|
|
|
</span>
|
2022-07-12 08:55:28 +00:00
|
|
|
<o-button
|
2021-11-02 18:47:54 +00:00
|
|
|
v-if="participation.event.participantStats.notApproved > 0"
|
|
|
|
type="is-text"
|
|
|
|
@click="
|
|
|
|
gotToWithCheck(participation, {
|
|
|
|
name: RouteName.PARTICIPATIONS,
|
|
|
|
query: { role: ParticipantRole.NOT_APPROVED },
|
|
|
|
params: { eventId: participation.event.uuid },
|
|
|
|
})
|
|
|
|
"
|
|
|
|
>
|
|
|
|
{{
|
2022-07-12 08:55:28 +00:00
|
|
|
$t(
|
2021-11-02 18:47:54 +00:00
|
|
|
"{count} requests waiting",
|
|
|
|
{
|
|
|
|
count: participation.event.participantStats.notApproved,
|
2022-07-12 08:55:28 +00:00
|
|
|
},
|
|
|
|
participation.event.participantStats.notApproved
|
2021-11-02 18:47:54 +00:00
|
|
|
)
|
|
|
|
}}
|
2022-07-12 08:55:28 +00:00
|
|
|
</o-button>
|
2019-09-26 14:38:58 +00:00
|
|
|
</span>
|
2021-06-11 16:31:24 +00:00
|
|
|
</div>
|
2019-09-26 14:38:58 +00:00
|
|
|
</div>
|
2022-07-12 08:55:28 +00:00
|
|
|
|
2022-08-12 14:46:44 +00:00
|
|
|
<o-dropdown aria-role="list" class="text-center self-center">
|
2022-07-12 08:55:28 +00:00
|
|
|
<template #trigger>
|
|
|
|
<o-button icon-right="dots-horizontal">
|
2021-06-11 16:31:24 +00:00
|
|
|
{{ $t("Actions") }}
|
2022-07-12 08:55:28 +00:00
|
|
|
</o-button>
|
|
|
|
</template>
|
|
|
|
<o-dropdown-item
|
|
|
|
aria-role="listitem"
|
|
|
|
v-if="
|
|
|
|
![
|
|
|
|
ParticipantRole.PARTICIPANT,
|
|
|
|
ParticipantRole.NOT_APPROVED,
|
|
|
|
].includes(participation.role)
|
|
|
|
"
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
class="flex gap-1"
|
2021-06-11 16:31:24 +00:00
|
|
|
@click="
|
|
|
|
gotToWithCheck(participation, {
|
|
|
|
name: RouteName.EDIT_EVENT,
|
|
|
|
params: { eventId: participation.event.uuid },
|
|
|
|
})
|
|
|
|
"
|
2020-02-18 07:57:00 +00:00
|
|
|
>
|
2022-07-12 08:55:28 +00:00
|
|
|
<Pencil />
|
2021-06-11 16:31:24 +00:00
|
|
|
{{ $t("Edit") }}
|
2022-07-12 08:55:28 +00:00
|
|
|
</div>
|
|
|
|
</o-dropdown-item>
|
2021-06-11 16:31:24 +00:00
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
<o-dropdown-item
|
|
|
|
aria-role="listitem"
|
|
|
|
v-if="participation.role === ParticipantRole.CREATOR"
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
class="flex gap-1"
|
2021-06-11 16:31:24 +00:00
|
|
|
@click="
|
|
|
|
gotToWithCheck(participation, {
|
|
|
|
name: RouteName.DUPLICATE_EVENT,
|
|
|
|
params: { eventId: participation.event.uuid },
|
|
|
|
})
|
|
|
|
"
|
|
|
|
>
|
2022-07-12 08:55:28 +00:00
|
|
|
<ContentDuplicate />
|
2021-06-11 16:31:24 +00:00
|
|
|
{{ $t("Duplicate") }}
|
2022-07-12 08:55:28 +00:00
|
|
|
</div>
|
|
|
|
</o-dropdown-item>
|
|
|
|
|
|
|
|
<o-dropdown-item
|
|
|
|
aria-role="listitem"
|
|
|
|
v-if="
|
|
|
|
![
|
|
|
|
ParticipantRole.PARTICIPANT,
|
|
|
|
ParticipantRole.NOT_APPROVED,
|
|
|
|
].includes(participation.role)
|
|
|
|
"
|
|
|
|
>
|
|
|
|
<div @click="openDeleteEventModalWrapper" class="flex gap-1">
|
|
|
|
<Delete />
|
2021-06-11 16:31:24 +00:00
|
|
|
{{ $t("Delete") }}
|
2022-07-12 08:55:28 +00:00
|
|
|
</div>
|
|
|
|
</o-dropdown-item>
|
|
|
|
|
|
|
|
<o-dropdown-item
|
|
|
|
aria-role="listitem"
|
|
|
|
v-if="
|
|
|
|
![
|
|
|
|
ParticipantRole.PARTICIPANT,
|
|
|
|
ParticipantRole.NOT_APPROVED,
|
|
|
|
].includes(participation.role)
|
|
|
|
"
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
class="flex gap-1"
|
2021-06-11 16:31:24 +00:00
|
|
|
@click="
|
|
|
|
gotToWithCheck(participation, {
|
|
|
|
name: RouteName.PARTICIPATIONS,
|
|
|
|
params: { eventId: participation.event.uuid },
|
|
|
|
})
|
|
|
|
"
|
|
|
|
>
|
2022-07-12 08:55:28 +00:00
|
|
|
<AccountMultiplePlus />
|
2021-06-11 16:31:24 +00:00
|
|
|
{{ $t("Manage participations") }}
|
2022-07-12 08:55:28 +00:00
|
|
|
</div>
|
|
|
|
</o-dropdown-item>
|
|
|
|
|
|
|
|
<o-dropdown-item aria-role="listitem">
|
|
|
|
<router-link
|
|
|
|
class="flex gap-1"
|
|
|
|
:to="{
|
|
|
|
name: RouteName.EVENT,
|
|
|
|
params: { uuid: participation.event.uuid },
|
|
|
|
}"
|
|
|
|
>
|
|
|
|
<ViewCompact />
|
|
|
|
{{ $t("View event page") }}
|
|
|
|
</router-link>
|
|
|
|
</o-dropdown-item>
|
|
|
|
</o-dropdown>
|
2019-09-18 15:32:37 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-02-18 07:57:00 +00:00
|
|
|
</article>
|
2019-09-18 15:32:37 +00:00
|
|
|
</template>
|
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
<script lang="ts" setup>
|
2020-02-18 07:57:00 +00:00
|
|
|
import DateCalendarIcon from "@/components/Event/DateCalendarIcon.vue";
|
2021-11-26 13:46:25 +00:00
|
|
|
import { EventStatus, EventVisibility, ParticipantRole } from "@/types/enums";
|
2022-07-12 08:55:28 +00:00
|
|
|
import { IParticipant } from "@/types/participant.model";
|
2021-11-02 18:47:54 +00:00
|
|
|
import {
|
2022-07-12 08:55:28 +00:00
|
|
|
IEvent,
|
2021-11-02 18:47:54 +00:00
|
|
|
IEventCardOptions,
|
|
|
|
organizer,
|
2022-07-12 08:55:28 +00:00
|
|
|
organizerAvatarUrl,
|
2021-11-02 18:47:54 +00:00
|
|
|
organizerDisplayName,
|
2022-07-12 08:55:28 +00:00
|
|
|
} from "@/types/event.model";
|
|
|
|
import { displayNameAndUsername, IActor, IPerson } from "@/types/actor";
|
|
|
|
import { CURRENT_ACTOR_CLIENT } from "@/graphql/actor";
|
|
|
|
import RouteName from "@/router/name";
|
|
|
|
import { changeIdentity } from "@/utils/identity";
|
2021-11-02 18:47:54 +00:00
|
|
|
import LazyImageWrapper from "@/components/Image/LazyImageWrapper.vue";
|
2021-11-06 10:15:16 +00:00
|
|
|
import InlineAddress from "@/components/Address/InlineAddress.vue";
|
2022-07-12 08:55:28 +00:00
|
|
|
import { RouteLocationRaw, useRouter } from "vue-router";
|
|
|
|
import Pencil from "vue-material-design-icons/Pencil.vue";
|
|
|
|
import ContentDuplicate from "vue-material-design-icons/ContentDuplicate.vue";
|
|
|
|
import Delete from "vue-material-design-icons/Delete.vue";
|
|
|
|
import AccountMultiplePlus from "vue-material-design-icons/AccountMultiplePlus.vue";
|
|
|
|
import ViewCompact from "vue-material-design-icons/ViewCompact.vue";
|
|
|
|
import AccountCircle from "vue-material-design-icons/AccountCircle.vue";
|
|
|
|
import AccountGroup from "vue-material-design-icons/AccountGroup.vue";
|
|
|
|
import Video from "vue-material-design-icons/Video.vue";
|
|
|
|
import { useProgrammatic } from "@oruga-ui/oruga-next";
|
|
|
|
import { computed, inject } from "vue";
|
|
|
|
import { useQuery } from "@vue/apollo-composable";
|
|
|
|
import { useI18n } from "vue-i18n";
|
|
|
|
import { Dialog } from "@/plugins/dialog";
|
|
|
|
import { Snackbar } from "@/plugins/snackbar";
|
|
|
|
import { useDeleteEvent } from "@/composition/apollo/event";
|
2019-09-18 15:32:37 +00:00
|
|
|
|
2019-10-05 19:17:18 +00:00
|
|
|
const defaultOptions: IEventCardOptions = {
|
|
|
|
hideDate: true,
|
|
|
|
loggedPerson: false,
|
|
|
|
hideDetails: false,
|
|
|
|
organizerActor: null,
|
|
|
|
};
|
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
const props = withDefaults(
|
|
|
|
defineProps<{
|
|
|
|
participation: IParticipant;
|
|
|
|
options: IEventCardOptions;
|
|
|
|
}>(),
|
|
|
|
{
|
|
|
|
options: () => ({
|
|
|
|
hideDate: true,
|
|
|
|
loggedPerson: false,
|
|
|
|
hideDetails: false,
|
|
|
|
organizerActor: null,
|
|
|
|
}),
|
|
|
|
}
|
|
|
|
);
|
2020-02-18 07:57:00 +00:00
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
const emit = defineEmits(["eventDeleted"]);
|
2020-02-18 07:57:00 +00:00
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
const { result: currentActorResult } = useQuery(CURRENT_ACTOR_CLIENT);
|
|
|
|
const currentActor = computed(() => currentActorResult.value?.currentActor);
|
|
|
|
const { t } = useI18n({ useScope: "global" });
|
2020-12-01 16:32:07 +00:00
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
const mergedOptions = computed<IEventCardOptions>(() => {
|
|
|
|
return { ...defaultOptions, ...props.options };
|
|
|
|
});
|
2021-11-02 18:47:54 +00:00
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
const dialog = inject<Dialog>("dialog");
|
2021-11-02 18:47:54 +00:00
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
const openDeleteEventModal = (
|
|
|
|
event: IEvent,
|
|
|
|
callback: (anEvent: IEvent) => any
|
|
|
|
): void => {
|
|
|
|
function escapeRegExp(string: string) {
|
|
|
|
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
|
|
|
|
}
|
|
|
|
const participantsLength = event.participantStats.participant;
|
|
|
|
const prefix = participantsLength
|
|
|
|
? t(
|
|
|
|
"There are {participants} participants.",
|
|
|
|
{
|
|
|
|
participants: participantsLength,
|
|
|
|
},
|
|
|
|
participantsLength
|
|
|
|
)
|
|
|
|
: "";
|
|
|
|
|
|
|
|
dialog?.prompt({
|
|
|
|
variant: "danger",
|
|
|
|
title: t("Delete event"),
|
|
|
|
message: `${prefix}
|
|
|
|
${t(
|
|
|
|
"Are you sure you want to delete this event? This action cannot be reverted."
|
|
|
|
)}
|
|
|
|
<br><br>
|
|
|
|
${t('To confirm, type your event title "{eventTitle}"', {
|
|
|
|
eventTitle: event.title,
|
|
|
|
})}`,
|
|
|
|
confirmText: t("Delete {eventTitle}", {
|
|
|
|
eventTitle: event.title,
|
|
|
|
}),
|
|
|
|
inputAttrs: {
|
|
|
|
placeholder: event.title,
|
|
|
|
pattern: escapeRegExp(event.title),
|
|
|
|
},
|
|
|
|
onConfirm: () => callback(event),
|
|
|
|
});
|
|
|
|
};
|
2019-09-18 15:32:37 +00:00
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
const { oruga } = useProgrammatic();
|
|
|
|
const snackbar = inject<Snackbar>("snackbar");
|
2021-11-26 13:46:25 +00:00
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
const {
|
|
|
|
mutate: deleteEvent,
|
|
|
|
onDone: onDeleteEventDone,
|
|
|
|
onError: onDeleteEventError,
|
|
|
|
} = useDeleteEvent();
|
2019-09-18 15:32:37 +00:00
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
onDeleteEventDone(() => {
|
2019-09-18 15:32:37 +00:00
|
|
|
/**
|
2022-07-12 08:55:28 +00:00
|
|
|
* When the event corresponding has been deleted (by the organizer).
|
|
|
|
* A notification is already triggered.
|
|
|
|
*
|
|
|
|
* @type {string}
|
2019-09-18 15:32:37 +00:00
|
|
|
*/
|
2022-07-12 08:55:28 +00:00
|
|
|
emit("eventDeleted", props.participation.event.id);
|
|
|
|
|
|
|
|
oruga.notification.open({
|
|
|
|
message: t("Event {eventTitle} deleted", {
|
|
|
|
eventTitle: props.participation.event.title,
|
|
|
|
}),
|
|
|
|
variant: "success",
|
|
|
|
position: "bottom-right",
|
|
|
|
duration: 5000,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
onDeleteEventError((error) => {
|
|
|
|
snackbar?.open({
|
|
|
|
message: error.message,
|
|
|
|
variant: "danger",
|
|
|
|
position: "bottom",
|
|
|
|
});
|
|
|
|
|
|
|
|
console.error(error);
|
|
|
|
});
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Delete the event
|
|
|
|
*/
|
|
|
|
const openDeleteEventModalWrapper = () => {
|
|
|
|
openDeleteEventModal(
|
|
|
|
props.participation.event,
|
|
|
|
deleteEvent(props.participation.event)
|
|
|
|
);
|
|
|
|
};
|
2019-09-18 15:32:37 +00:00
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
const gotToWithCheck = async (
|
|
|
|
participation: IParticipant,
|
|
|
|
route: RouteLocationRaw
|
|
|
|
): Promise<any> => {
|
|
|
|
if (
|
|
|
|
participation.actor.id !== currentActor.value.id &&
|
|
|
|
participation.event.organizerActor
|
|
|
|
) {
|
|
|
|
const organizerActor = participation.event.organizerActor as IPerson;
|
|
|
|
await changeIdentity(organizerActor);
|
|
|
|
oruga.notification.open({
|
|
|
|
message: t(
|
|
|
|
"Current identity has been changed to {identityName} in order to manage this event.",
|
|
|
|
{
|
|
|
|
identityName: organizerActor.preferredUsername,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
variant: "info",
|
|
|
|
position: "bottom-right",
|
|
|
|
duration: 5000,
|
|
|
|
});
|
2019-10-13 14:24:43 +00:00
|
|
|
}
|
2022-07-12 08:55:28 +00:00
|
|
|
return router.push(route);
|
|
|
|
};
|
2020-12-01 16:32:07 +00:00
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
const organizerActor = computed<IActor | undefined>(() => {
|
|
|
|
if (
|
|
|
|
props.participation.event.attributedTo &&
|
|
|
|
props.participation.event.attributedTo.id
|
|
|
|
) {
|
|
|
|
return props.participation.event.attributedTo;
|
2020-12-01 16:32:07 +00:00
|
|
|
}
|
2022-07-12 08:55:28 +00:00
|
|
|
return props.participation.event.organizerActor;
|
|
|
|
});
|
|
|
|
|
|
|
|
const seatsLeft = computed<number | null>(() => {
|
|
|
|
if (props.participation.event.options.maximumAttendeeCapacity > 0) {
|
|
|
|
return (
|
|
|
|
props.participation.event.options.maximumAttendeeCapacity -
|
|
|
|
props.participation.event.participantStats.participant
|
|
|
|
);
|
2021-11-02 18:47:54 +00:00
|
|
|
}
|
2022-07-12 08:55:28 +00:00
|
|
|
return null;
|
|
|
|
});
|
2021-11-02 18:47:54 +00:00
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
const lastSeatsLeft = computed<boolean>(() => {
|
|
|
|
if (seatsLeft.value) {
|
|
|
|
return seatsLeft.value < 10;
|
2021-11-02 18:47:54 +00:00
|
|
|
}
|
2022-07-12 08:55:28 +00:00
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
|
|
|
const actorAvatarURL = computed<string | null>(() =>
|
|
|
|
organizerAvatarUrl(props.participation.event)
|
|
|
|
);
|
|
|
|
|
|
|
|
// export default class EventParticipationCard extends mixins(
|
|
|
|
// ActorMixin,
|
|
|
|
// EventMixin
|
|
|
|
// ) {
|
|
|
|
|
|
|
|
// }
|
2019-09-18 15:32:37 +00:00
|
|
|
</script>
|
|
|
|
|
2019-10-13 14:24:43 +00:00
|
|
|
<style lang="scss" scoped>
|
2021-11-04 17:14:36 +00:00
|
|
|
@use "@/styles/_mixins" as *;
|
2022-07-12 08:55:28 +00:00
|
|
|
// @import "node_modules/bulma/sass/utilities/mixins.sass";
|
2021-11-02 18:47:54 +00:00
|
|
|
|
2020-02-18 07:57:00 +00:00
|
|
|
article.box {
|
2022-07-12 08:55:28 +00:00
|
|
|
// div.tag-container {
|
|
|
|
// position: absolute;
|
|
|
|
// top: 10px;
|
|
|
|
// right: 0;
|
|
|
|
// @include margin-left(-5px);
|
|
|
|
// z-index: 10;
|
|
|
|
// max-width: 40%;
|
|
|
|
|
|
|
|
// span.tag {
|
|
|
|
// margin: 5px auto;
|
|
|
|
// box-shadow: 0 0 5px 0 rgba(0, 0, 0, 1);
|
|
|
|
// /*word-break: break-all;*/
|
|
|
|
// text-overflow: ellipsis;
|
|
|
|
// overflow: hidden;
|
|
|
|
// display: block;
|
|
|
|
// /*text-align: right;*/
|
|
|
|
// font-size: 1em;
|
|
|
|
// /*padding: 0 1px;*/
|
|
|
|
// line-height: 1.75em;
|
|
|
|
// }
|
|
|
|
// }
|
2019-09-18 15:32:37 +00:00
|
|
|
|
2020-12-01 16:32:07 +00:00
|
|
|
.list-card {
|
2022-07-12 08:55:28 +00:00
|
|
|
// display: flex;
|
|
|
|
// padding: 0 6px 0 0;
|
|
|
|
// position: relative;
|
|
|
|
// flex-direction: column;
|
2019-10-13 14:24:43 +00:00
|
|
|
|
2021-06-11 16:31:24 +00:00
|
|
|
.content-and-actions {
|
2022-07-12 08:55:28 +00:00
|
|
|
// display: grid;
|
|
|
|
// grid-gap: 5px 10px;
|
2021-11-02 18:47:54 +00:00
|
|
|
grid-template-areas: "preview" "body" "actions";
|
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
// @include tablet {
|
|
|
|
// grid-template-columns: 1fr 3fr;
|
|
|
|
// grid-template-areas: "preview body" "actions actions";
|
|
|
|
// }
|
2021-11-02 18:47:54 +00:00
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
// @include desktop {
|
|
|
|
// grid-template-columns: 1fr 3fr 1fr;
|
|
|
|
// grid-template-areas: "preview body actions";
|
|
|
|
// }
|
2021-11-02 18:47:54 +00:00
|
|
|
|
|
|
|
.event-preview {
|
|
|
|
grid-area: preview;
|
|
|
|
|
|
|
|
& > div {
|
|
|
|
height: 128px;
|
2022-07-12 08:55:28 +00:00
|
|
|
// width: 100%;
|
|
|
|
// position: relative;
|
|
|
|
|
|
|
|
// div.date-component {
|
|
|
|
// display: flex;
|
|
|
|
// position: absolute;
|
|
|
|
// bottom: 5px;
|
|
|
|
// left: 5px;
|
|
|
|
// z-index: 1;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// img {
|
|
|
|
// width: 100%;
|
|
|
|
// object-position: center;
|
|
|
|
// object-fit: cover;
|
|
|
|
// height: 100%;
|
|
|
|
// }
|
2021-11-02 18:47:54 +00:00
|
|
|
}
|
|
|
|
}
|
2020-06-17 13:54:24 +00:00
|
|
|
|
2021-06-11 16:31:24 +00:00
|
|
|
.actions {
|
2022-07-12 08:55:28 +00:00
|
|
|
// padding: 7px;
|
|
|
|
// cursor: pointer;
|
|
|
|
// align-self: center;
|
|
|
|
// justify-self: center;
|
2021-11-02 18:47:54 +00:00
|
|
|
grid-area: actions;
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
2019-10-13 14:24:43 +00:00
|
|
|
|
2021-06-11 16:31:24 +00:00
|
|
|
div.list-card-content {
|
2022-07-12 08:55:28 +00:00
|
|
|
// flex: 1;
|
|
|
|
// padding: 5px;
|
2021-11-02 18:47:54 +00:00
|
|
|
grid-area: body;
|
2019-10-13 14:24:43 +00:00
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
// .participant-stats {
|
|
|
|
// display: flex;
|
|
|
|
// align-items: center;
|
|
|
|
// padding: 0 5px;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// div.title-wrapper {
|
|
|
|
// display: flex;
|
|
|
|
// align-items: center;
|
|
|
|
// padding-top: 5px;
|
|
|
|
|
|
|
|
// a {
|
|
|
|
// text-decoration: none;
|
|
|
|
// padding-bottom: 5px;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// .title {
|
|
|
|
// display: -webkit-box;
|
|
|
|
// -webkit-line-clamp: 3;
|
|
|
|
// -webkit-box-orient: vertical;
|
|
|
|
// overflow: hidden;
|
|
|
|
// font-size: 18px;
|
|
|
|
// line-height: 24px;
|
|
|
|
// margin: auto 0;
|
|
|
|
// font-weight: bold;
|
|
|
|
// }
|
|
|
|
// }
|
2019-09-18 15:32:37 +00:00
|
|
|
}
|
2020-12-01 16:32:07 +00:00
|
|
|
}
|
|
|
|
}
|
2020-02-18 07:57:00 +00:00
|
|
|
|
2022-07-12 08:55:28 +00:00
|
|
|
// .identity-header {
|
|
|
|
// display: flex;
|
|
|
|
// padding: 5px;
|
|
|
|
|
|
|
|
// figure,
|
|
|
|
// span.icon {
|
|
|
|
// @include padding-right(3px);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
// & > .columns {
|
|
|
|
// padding: 1.25rem;
|
|
|
|
// }
|
|
|
|
// padding: 0;
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
2019-09-18 15:32:37 +00:00
|
|
|
</style>
|