2019-12-20 13:04:34 +01:00
|
|
|
<template>
|
|
|
|
<article class="box">
|
|
|
|
<div class="columns">
|
|
|
|
<div class="content column">
|
|
|
|
<div class="title-wrapper">
|
|
|
|
<div class="date-component">
|
|
|
|
<date-calendar-icon :date="event.beginsOn" />
|
|
|
|
</div>
|
2020-11-30 10:24:11 +01:00
|
|
|
<router-link
|
|
|
|
:to="{ name: RouteName.EVENT, params: { uuid: event.uuid } }"
|
|
|
|
>
|
2020-02-18 08:57:00 +01:00
|
|
|
<h2 class="title">{{ event.title }}</h2>
|
|
|
|
</router-link>
|
2019-12-20 13:04:34 +01:00
|
|
|
</div>
|
|
|
|
<div class="participation-actor has-text-grey">
|
2020-02-18 08:57:00 +01:00
|
|
|
<span v-if="event.physicalAddress && event.physicalAddress.locality">
|
|
|
|
{{ event.physicalAddress.locality }}
|
|
|
|
</span>
|
2020-10-01 15:57:07 +02:00
|
|
|
<span v-if="event.attributedTo && options.memberofGroup">
|
2020-11-30 10:24:11 +01:00
|
|
|
{{
|
|
|
|
$t("Created by {name}", {
|
|
|
|
name: usernameWithDomain(event.organizerActor),
|
|
|
|
})
|
|
|
|
}}
|
2020-10-01 15:57:07 +02:00
|
|
|
</span>
|
|
|
|
<span v-else-if="options.memberofGroup">
|
2020-11-30 10:24:11 +01:00
|
|
|
{{
|
|
|
|
$t("Organized by {name}", {
|
|
|
|
name: usernameWithDomain(event.organizerActor),
|
|
|
|
})
|
|
|
|
}}
|
2019-12-20 13:04:34 +01:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class="columns">
|
|
|
|
<span class="column is-narrow">
|
2020-11-30 10:24:11 +01:00
|
|
|
<b-icon
|
|
|
|
icon="earth"
|
|
|
|
v-if="event.visibility === EventVisibility.PUBLIC"
|
|
|
|
/>
|
|
|
|
<b-icon
|
|
|
|
icon="link"
|
|
|
|
v-if="event.visibility === EventVisibility.UNLISTED"
|
|
|
|
/>
|
|
|
|
<b-icon
|
|
|
|
icon="lock"
|
|
|
|
v-if="event.visibility === EventVisibility.PRIVATE"
|
|
|
|
/>
|
2019-12-20 13:04:34 +01:00
|
|
|
</span>
|
|
|
|
<span class="column is-narrow participant-stats">
|
|
|
|
<span v-if="event.options.maximumAttendeeCapacity !== 0">
|
2020-02-18 08:57:00 +01:00
|
|
|
{{
|
|
|
|
$t("{approved} / {total} seats", {
|
|
|
|
approved: event.participantStats.participant,
|
|
|
|
total: event.options.maximumAttendeeCapacity,
|
|
|
|
})
|
|
|
|
}}
|
2019-12-20 13:04:34 +01:00
|
|
|
</span>
|
|
|
|
<span v-else>
|
2020-02-18 08:57:00 +01:00
|
|
|
{{
|
2020-11-30 10:24:11 +01:00
|
|
|
$tc(
|
|
|
|
"{count} participants",
|
|
|
|
event.participantStats.participant,
|
|
|
|
{
|
|
|
|
count: event.participantStats.participant,
|
|
|
|
}
|
|
|
|
)
|
2020-02-18 08:57:00 +01:00
|
|
|
}}
|
2019-12-20 13:04:34 +01:00
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-02-18 08:57:00 +01:00
|
|
|
</article>
|
2019-12-20 13:04:34 +01:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-11-27 19:27:44 +01:00
|
|
|
import { IEventCardOptions, IEvent } from "@/types/event.model";
|
2020-02-18 08:57:00 +01:00
|
|
|
import { Component, Prop } from "vue-property-decorator";
|
|
|
|
import DateCalendarIcon from "@/components/Event/DateCalendarIcon.vue";
|
2020-09-02 17:42:17 +02:00
|
|
|
import { IPerson, usernameWithDomain } from "@/types/actor";
|
2020-02-18 08:57:00 +01:00
|
|
|
import { mixins } from "vue-class-component";
|
|
|
|
import ActorMixin from "@/mixins/actor";
|
|
|
|
import { CURRENT_ACTOR_CLIENT } from "@/graphql/actor";
|
|
|
|
import EventMixin from "@/mixins/event";
|
2020-11-27 19:27:44 +01:00
|
|
|
import { EventVisibility, ParticipantRole } from "@/types/enums";
|
2020-02-18 08:57:00 +01:00
|
|
|
import RouteName from "../../router/name";
|
2019-12-20 13:04:34 +01:00
|
|
|
|
|
|
|
const defaultOptions: IEventCardOptions = {
|
|
|
|
hideDate: true,
|
|
|
|
loggedPerson: false,
|
|
|
|
hideDetails: false,
|
|
|
|
organizerActor: null,
|
2020-10-01 15:57:07 +02:00
|
|
|
memberofGroup: false,
|
2019-12-20 13:04:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
components: {
|
|
|
|
DateCalendarIcon,
|
|
|
|
},
|
|
|
|
apollo: {
|
|
|
|
currentActor: {
|
|
|
|
query: CURRENT_ACTOR_CLIENT,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
export default class EventListViewCard extends mixins(ActorMixin, EventMixin) {
|
|
|
|
/**
|
|
|
|
* The participation associated
|
|
|
|
*/
|
2020-08-31 12:40:30 +02:00
|
|
|
@Prop({ required: true }) event!: IEvent;
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2019-12-20 13:04:34 +01:00
|
|
|
/**
|
|
|
|
* Options are merged with default options
|
|
|
|
*/
|
2020-02-18 08:57:00 +01:00
|
|
|
@Prop({ required: false, default: () => defaultOptions })
|
|
|
|
options!: IEventCardOptions;
|
2019-12-20 13:04:34 +01:00
|
|
|
|
|
|
|
currentActor!: IPerson;
|
|
|
|
|
|
|
|
ParticipantRole = ParticipantRole;
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2019-12-20 13:04:34 +01:00
|
|
|
EventVisibility = EventVisibility;
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
RouteName = RouteName;
|
2020-09-02 17:42:17 +02:00
|
|
|
|
|
|
|
usernameWithDomain = usernameWithDomain;
|
2019-12-20 13:04:34 +01:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2020-02-18 08:57:00 +01:00
|
|
|
article.box {
|
|
|
|
div.content {
|
|
|
|
padding: 5px;
|
2019-12-20 13:04:34 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
.participation-actor span,
|
|
|
|
.participant-stats span {
|
|
|
|
padding: 0 5px;
|
2019-12-20 13:04:34 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
button {
|
|
|
|
height: auto;
|
|
|
|
padding-top: 0;
|
2019-12-20 13:04:34 +01:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2019-12-20 13:04:34 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
div.title-wrapper {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2019-12-20 13:04:34 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
div.date-component {
|
|
|
|
flex: 0;
|
|
|
|
margin-right: 16px;
|
|
|
|
}
|
2019-12-20 13:04:34 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
.title {
|
|
|
|
display: -webkit-box;
|
|
|
|
-webkit-line-clamp: 1;
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
overflow: hidden;
|
|
|
|
font-weight: 400;
|
|
|
|
line-height: 1em;
|
|
|
|
font-size: 1.6em;
|
|
|
|
padding-bottom: 5px;
|
|
|
|
margin: auto 0;
|
2019-12-20 13:04:34 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2019-12-20 13:04:34 +01:00
|
|
|
</style>
|