2019-01-21 15:08:22 +01:00
|
|
|
<template>
|
2020-11-30 10:24:11 +01:00
|
|
|
<router-link
|
|
|
|
class="card"
|
2021-11-06 10:08:20 +01:00
|
|
|
:to="{ name: RouteName.EVENT, params: { uuid: event.uuid } }"
|
2020-11-30 10:24:11 +01:00
|
|
|
>
|
2019-10-14 11:41:57 +02:00
|
|
|
<div class="card-image">
|
2021-06-10 09:41:07 +02:00
|
|
|
<figure class="image is-16by9">
|
|
|
|
<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
|
|
|
|
class="tag-container"
|
|
|
|
v-if="event.tags || event.status !== EventStatus.CONFIRMED"
|
|
|
|
>
|
|
|
|
<b-tag type="is-info" v-if="event.status === EventStatus.TENTATIVE">
|
|
|
|
{{ $t("Tentative") }}
|
|
|
|
</b-tag>
|
|
|
|
<b-tag type="is-danger" v-if="event.status === EventStatus.CANCELLED">
|
|
|
|
{{ $t("Cancelled") }}
|
|
|
|
</b-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"
|
|
|
|
>
|
2021-11-07 14:59:20 +01:00
|
|
|
<b-tag type="is-light" dir="auto">{{ tag.title }}</b-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>
|
2020-02-18 08:47:41 +01:00
|
|
|
<div class="card-content">
|
|
|
|
<div class="media">
|
|
|
|
<div class="media-left">
|
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"
|
|
|
|
:date="event.beginsOn"
|
|
|
|
/>
|
2019-01-21 15:08:22 +01:00
|
|
|
</div>
|
2020-02-18 08:47:41 +01:00
|
|
|
<div class="media-content">
|
2021-11-07 14:59:20 +01:00
|
|
|
<h3 class="event-title" :title="event.title" dir="auto">
|
|
|
|
{{ event.title }}
|
|
|
|
</h3>
|
2021-11-06 14:37:02 +01:00
|
|
|
<div class="content-end">
|
2021-11-07 14:59:20 +01:00
|
|
|
<div class="event-organizer" dir="auto">
|
2021-11-06 14:37:02 +01:00
|
|
|
<figure
|
|
|
|
class="image is-24x24"
|
|
|
|
v-if="organizer(event) && organizer(event).avatar"
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
class="is-rounded"
|
|
|
|
:src="organizer(event).avatar.url"
|
|
|
|
alt=""
|
|
|
|
/>
|
|
|
|
</figure>
|
|
|
|
<b-icon v-else icon="account-circle" />
|
|
|
|
<span class="organizer-name">
|
|
|
|
{{ organizerDisplayName(event) }}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<inline-address
|
2021-11-07 14:59:20 +01:00
|
|
|
dir="auto"
|
2021-11-06 14:37:02 +01:00
|
|
|
v-if="event.physicalAddress"
|
|
|
|
class="event-subtitle"
|
|
|
|
:physical-address="event.physicalAddress"
|
|
|
|
/>
|
|
|
|
<div
|
|
|
|
class="event-subtitle"
|
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
|
|
|
>
|
2021-11-06 14:37:02 +01:00
|
|
|
<b-icon icon="video" />
|
|
|
|
<span>{{ $t("Online") }}</span>
|
|
|
|
</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>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-10-29 10:54:35 +02:00
|
|
|
import {
|
|
|
|
IEvent,
|
|
|
|
IEventCardOptions,
|
|
|
|
organizerDisplayName,
|
|
|
|
organizer,
|
|
|
|
} from "@/types/event.model";
|
2020-02-18 08:57:00 +01:00
|
|
|
import { Component, Prop, Vue } from "vue-property-decorator";
|
|
|
|
import DateCalendarIcon from "@/components/Event/DateCalendarIcon.vue";
|
2021-06-10 09:41:07 +02:00
|
|
|
import LazyImageWrapper from "@/components/Image/LazyImageWrapper.vue";
|
2020-02-18 08:57:00 +01:00
|
|
|
import { Actor, Person } from "@/types/actor";
|
2020-12-01 12:33:17 +01:00
|
|
|
import { EventStatus, ParticipantRole } 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
|
|
|
|
2019-03-21 20:23:42 +01:00
|
|
|
@Component({
|
|
|
|
components: {
|
2019-04-03 17:29:03 +02:00
|
|
|
DateCalendarIcon,
|
2021-06-10 09:41:07 +02:00
|
|
|
LazyImageWrapper,
|
2021-11-06 11:15:16 +01:00
|
|
|
InlineAddress,
|
2019-03-21 20:23:42 +01:00
|
|
|
},
|
|
|
|
})
|
2019-01-21 15:08:22 +01:00
|
|
|
export default class EventCard extends Vue {
|
|
|
|
@Prop({ required: true }) event!: IEvent;
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2019-04-03 17:29:03 +02:00
|
|
|
@Prop({ required: false }) options!: IEventCardOptions;
|
|
|
|
|
|
|
|
ParticipantRole = ParticipantRole;
|
|
|
|
|
2020-12-01 12:33:17 +01:00
|
|
|
EventStatus = EventStatus;
|
|
|
|
|
2020-07-31 17:52:26 +02:00
|
|
|
RouteName = RouteName;
|
|
|
|
|
2021-10-29 10:54:35 +02:00
|
|
|
organizerDisplayName = organizerDisplayName;
|
|
|
|
|
|
|
|
organizer = organizer;
|
|
|
|
|
2019-04-03 17:29:03 +02:00
|
|
|
defaultOptions: IEventCardOptions = {
|
|
|
|
hideDate: false,
|
|
|
|
loggedPerson: false,
|
|
|
|
hideDetails: false,
|
|
|
|
organizerActor: null,
|
2020-10-01 16:13:07 +02:00
|
|
|
memberofGroup: false,
|
2019-04-03 17:29:03 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
get mergedOptions(): IEventCardOptions {
|
|
|
|
return { ...this.defaultOptions, ...this.options };
|
|
|
|
}
|
2019-02-07 16:37:40 +01:00
|
|
|
|
2020-02-18 08:47:41 +01:00
|
|
|
get actor(): Actor {
|
2020-02-18 08:57:00 +01:00
|
|
|
return Object.assign(
|
|
|
|
new Person(),
|
|
|
|
this.event.organizerActor || this.mergedOptions.organizerActor
|
|
|
|
);
|
2019-02-07 16:37:40 +01:00
|
|
|
}
|
2019-01-21 15:08:22 +01:00
|
|
|
}
|
|
|
|
</script>
|
2019-04-03 17:29:03 +02:00
|
|
|
|
2019-11-15 18:36:47 +01:00
|
|
|
<style lang="scss" scoped>
|
2021-11-04 18:14:36 +01:00
|
|
|
@use "@/styles/_mixins" as *;
|
2021-11-02 19:47:54 +01:00
|
|
|
@use "@/styles/_event-card";
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
a.card {
|
|
|
|
display: block;
|
|
|
|
background: $secondary;
|
2020-06-17 15:54:24 +02:00
|
|
|
color: #3c376e;
|
2019-04-03 17:29:03 +02:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
&:hover {
|
|
|
|
// box-shadow: 0 0 5px 0 rgba(0, 0, 0, 1);
|
|
|
|
transform: scale(1.01, 1.01);
|
|
|
|
&:after {
|
|
|
|
opacity: 1;
|
2019-10-07 16:48:13 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
border-radius: 5px;
|
|
|
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
|
|
transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
|
2019-10-07 16:48:13 +02:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
&:after {
|
|
|
|
content: "";
|
2019-10-07 16:48:13 +02:00
|
|
|
border-radius: 5px;
|
2020-02-18 08:57:00 +01:00
|
|
|
position: absolute;
|
|
|
|
z-index: -1;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
|
|
|
|
opacity: 0;
|
2019-10-07 16:48:13 +02:00
|
|
|
transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2019-10-07 16:48:13 +02:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
div.tag-container {
|
|
|
|
position: absolute;
|
|
|
|
top: 10px;
|
|
|
|
right: 0;
|
2021-11-04 18:14:36 +01:00
|
|
|
@include margin-right(-3px);
|
2020-02-18 08:57:00 +01:00
|
|
|
z-index: 10;
|
|
|
|
max-width: 40%;
|
|
|
|
|
2020-07-31 17:52:26 +02:00
|
|
|
a {
|
|
|
|
text-decoration: none;
|
|
|
|
|
|
|
|
span.tag {
|
|
|
|
margin: 5px auto;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
|
|
|
display: block;
|
|
|
|
font-size: 0.9em;
|
|
|
|
line-height: 1.75em;
|
|
|
|
background-color: #e6e4f4;
|
|
|
|
color: #3c376e;
|
|
|
|
}
|
2019-10-07 16:48:13 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2019-10-07 16:48:13 +02:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
div.card-image {
|
|
|
|
background: $secondary;
|
2019-04-24 20:49:52 +02:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
figure.image {
|
|
|
|
background-size: cover;
|
|
|
|
background-position: center;
|
2019-04-24 20:49:52 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2019-04-24 20:49:52 +02:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
.card-content {
|
2021-11-06 14:37:02 +01:00
|
|
|
height: 100%;
|
2020-02-18 08:57:00 +01:00
|
|
|
padding: 0.5rem;
|
|
|
|
|
2021-06-10 09:41:07 +02:00
|
|
|
& > .media {
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2021-11-06 14:37:02 +01:00
|
|
|
height: 100%;
|
2021-06-10 09:41:07 +02:00
|
|
|
|
|
|
|
& > .media-left {
|
|
|
|
margin-top: -15px;
|
|
|
|
height: 0;
|
|
|
|
display: flex;
|
|
|
|
align-items: flex-end;
|
|
|
|
align-self: flex-start;
|
|
|
|
margin-bottom: 15px;
|
2021-11-04 18:14:36 +01:00
|
|
|
@include margin-left(0);
|
2021-06-10 09:41:07 +02:00
|
|
|
}
|
2021-10-29 10:54:35 +02:00
|
|
|
|
|
|
|
& > .media-content {
|
|
|
|
flex: 1;
|
|
|
|
width: 100%;
|
|
|
|
overflow-x: inherit;
|
2021-11-06 14:37:02 +01:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: space-between;
|
2021-10-29 10:54:35 +02:00
|
|
|
}
|
2021-06-10 09:41:07 +02:00
|
|
|
}
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
.event-title {
|
2021-10-29 10:54:35 +02:00
|
|
|
font-size: 18px;
|
|
|
|
line-height: 24px;
|
2020-02-18 08:57:00 +01:00
|
|
|
display: -webkit-box;
|
2021-10-29 10:54:35 +02:00
|
|
|
-webkit-line-clamp: 3;
|
2020-02-18 08:57:00 +01:00
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
overflow: hidden;
|
2021-11-02 19:47:54 +01:00
|
|
|
padding-bottom: 8px;
|
2020-06-17 15:54:24 +02:00
|
|
|
font-weight: bold;
|
2019-04-03 17:29:03 +02:00
|
|
|
}
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
.event-subtitle {
|
|
|
|
font-size: 0.85rem;
|
2021-11-02 19:47:54 +01:00
|
|
|
}
|
2021-10-29 10:54:35 +02:00
|
|
|
|
2021-11-02 19:47:54 +01:00
|
|
|
.organizer-name {
|
|
|
|
font-size: 14px;
|
2019-04-03 17:29:03 +02:00
|
|
|
}
|
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2019-04-03 17:29:03 +02:00
|
|
|
</style>
|