2020-02-18 08:57:00 +01:00
|
|
|
<template>
|
|
|
|
<router-link
|
|
|
|
class="event-minimalist-card-wrapper"
|
|
|
|
:to="{ name: RouteName.EVENT, params: { uuid: event.uuid } }"
|
|
|
|
>
|
2021-11-02 19:47:54 +01:00
|
|
|
<div class="event-preview mr-0 ml-0">
|
|
|
|
<div>
|
|
|
|
<div class="date-component">
|
|
|
|
<date-calendar-icon :date="event.beginsOn" :small="true" />
|
|
|
|
</div>
|
|
|
|
<lazy-image-wrapper
|
|
|
|
:picture="event.picture"
|
|
|
|
:rounded="true"
|
|
|
|
style="height: 100%; position: absolute; top: 0; left: 0; width: 100%"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="title-info-wrapper has-text-grey-dark">
|
|
|
|
<h3 class="event-minimalist-title">
|
|
|
|
<b-tag
|
|
|
|
class="mr-2"
|
|
|
|
type="is-warning"
|
|
|
|
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"
|
|
|
|
>
|
|
|
|
<b-icon icon="video" />
|
|
|
|
<span>{{ $t("Online") }}</span>
|
|
|
|
</div>
|
|
|
|
<div class="event-subtitle event-organizer" v-if="showOrganizer">
|
|
|
|
<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>
|
|
|
|
<p class="participant-metadata">
|
|
|
|
<b-icon icon="account-multiple" />
|
2020-09-02 17:42:17 +02:00
|
|
|
<span v-if="event.options.maximumAttendeeCapacity !== 0">
|
|
|
|
{{
|
|
|
|
$tc(
|
|
|
|
"{available}/{capacity} available places",
|
2020-11-30 10:24:11 +01:00
|
|
|
event.options.maximumAttendeeCapacity -
|
|
|
|
event.participantStats.participant,
|
2020-09-02 17:42:17 +02:00
|
|
|
{
|
|
|
|
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,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
</span>
|
|
|
|
<span v-else>
|
|
|
|
{{
|
|
|
|
$tc("{count} participants", event.participantStats.participant, {
|
|
|
|
count: event.participantStats.participant,
|
|
|
|
})
|
|
|
|
}}
|
|
|
|
</span>
|
|
|
|
<span v-if="event.participantStats.notApproved > 0">
|
|
|
|
<b-button
|
|
|
|
type="is-text"
|
|
|
|
@click="
|
|
|
|
gotToWithCheck(participation, {
|
|
|
|
name: RouteName.PARTICIPATIONS,
|
|
|
|
query: { role: ParticipantRole.NOT_APPROVED },
|
|
|
|
params: { eventId: event.uuid },
|
|
|
|
})
|
|
|
|
"
|
|
|
|
>
|
|
|
|
{{
|
2020-11-30 10:24:11 +01:00
|
|
|
$tc(
|
|
|
|
"{count} requests waiting",
|
|
|
|
event.participantStats.notApproved,
|
|
|
|
{
|
|
|
|
count: event.participantStats.notApproved,
|
|
|
|
}
|
|
|
|
)
|
2020-09-02 17:42:17 +02:00
|
|
|
}}
|
|
|
|
</b-button>
|
|
|
|
</span>
|
|
|
|
</p>
|
2020-02-18 08:57:00 +01:00
|
|
|
</div>
|
|
|
|
</router-link>
|
|
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Prop, Vue } from "vue-property-decorator";
|
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";
|
2020-11-27 19:27:44 +01:00
|
|
|
import { 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";
|
2020-02-18 08:57:00 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
components: {
|
|
|
|
DateCalendarIcon,
|
2021-11-02 19:47:54 +01:00
|
|
|
LazyImageWrapper,
|
2021-11-06 11:15:16 +01:00
|
|
|
InlineAddress,
|
2020-02-18 08:57:00 +01:00
|
|
|
},
|
|
|
|
})
|
|
|
|
export default class EventMinimalistCard extends Vue {
|
|
|
|
@Prop({ required: true, type: Object }) event!: IEvent;
|
2021-11-02 19:47:54 +01:00
|
|
|
@Prop({ required: false, type: Boolean, default: false })
|
|
|
|
showOrganizer!: boolean;
|
2020-02-18 08:57:00 +01:00
|
|
|
|
|
|
|
RouteName = RouteName;
|
2020-11-06 11:34:32 +01:00
|
|
|
|
|
|
|
ParticipantRole = ParticipantRole;
|
2021-11-02 19:47:54 +01:00
|
|
|
|
|
|
|
organizerDisplayName = organizerDisplayName;
|
|
|
|
|
|
|
|
organizer = organizer;
|
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 *;
|
2021-11-02 19:47:54 +01:00
|
|
|
@use "@/styles/_event-card";
|
|
|
|
@import "~bulma/sass/utilities/mixins.sass";
|
|
|
|
@import "@/variables.scss";
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
.event-minimalist-card-wrapper {
|
2021-11-02 19:47:54 +01:00
|
|
|
display: grid;
|
|
|
|
grid-gap: 5px 10px;
|
|
|
|
grid-template-areas: "preview" "body";
|
2020-02-18 08:57:00 +01:00
|
|
|
color: initial;
|
2021-11-02 19:47:54 +01:00
|
|
|
|
|
|
|
@include desktop {
|
|
|
|
grid-template-columns: 200px 3fr;
|
|
|
|
grid-template-areas: "preview body";
|
|
|
|
}
|
|
|
|
|
|
|
|
.event-preview {
|
|
|
|
& > div {
|
|
|
|
position: relative;
|
|
|
|
height: 120px;
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
div.date-component {
|
|
|
|
display: flex;
|
|
|
|
position: absolute;
|
|
|
|
bottom: 5px;
|
|
|
|
left: 5px;
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
|
|
|
|
.calendar-icon {
|
2021-11-04 18:14:36 +01:00
|
|
|
@include margin-right(1rem);
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.title-info-wrapper {
|
|
|
|
flex: 2;
|
|
|
|
|
|
|
|
.event-minimalist-title {
|
2021-11-02 19:47:54 +01:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
::v-deep .icon {
|
|
|
|
vertical-align: middle;
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|