2019-01-21 15:08:22 +01:00
|
|
|
<template>
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-image" v-if="!event.image">
|
|
|
|
<figure class="image is-4by3">
|
|
|
|
<img src="https://picsum.photos/g/400/200/">
|
|
|
|
</figure>
|
|
|
|
</div>
|
|
|
|
<div class="card-content">
|
|
|
|
<div class="content">
|
|
|
|
<router-link :to="{ name: 'Event', params:{ uuid: event.uuid } }">
|
|
|
|
<h2 class="title">{{ event.title }}</h2>
|
|
|
|
</router-link>
|
2019-03-22 10:57:14 +01:00
|
|
|
<span>{{ event.beginsOn | formatDay }}</span>
|
2019-01-21 15:08:22 +01:00
|
|
|
</div>
|
|
|
|
<div v-if="!hideDetails">
|
|
|
|
<div v-if="event.participants.length === 1">
|
|
|
|
<translate
|
|
|
|
:translate-params="{name: event.participants[0].actor.preferredUsername}"
|
|
|
|
>%{name} organizes this event</translate>
|
|
|
|
</div>
|
|
|
|
<div v-else>
|
|
|
|
<span v-for="participant in event.participants" :key="participant.actor.uuid">
|
|
|
|
{{ participant.actor.preferredUsername }}
|
2019-02-07 16:37:40 +01:00
|
|
|
<span v-if="participant.role === ParticipantRole.CREATOR">(organizer)</span>,
|
2019-01-21 15:08:22 +01:00
|
|
|
<!-- <translate
|
|
|
|
:translate-params="{name: participant.actor.preferredUsername}"
|
|
|
|
> %{name} is in,</translate>-->
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2019-03-22 10:57:14 +01:00
|
|
|
import { IEvent, ParticipantRole } from '@/types/event.model';
|
|
|
|
import { Component, Prop, Vue } from 'vue-property-decorator';
|
2019-01-21 15:08:22 +01:00
|
|
|
|
|
|
|
@Component
|
|
|
|
export default class EventCard extends Vue {
|
|
|
|
@Prop({ required: true }) event!: IEvent;
|
|
|
|
@Prop({ default: false }) hideDetails!: boolean;
|
2019-02-07 16:37:40 +01:00
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
2019-03-22 10:57:14 +01:00
|
|
|
ParticipantRole,
|
|
|
|
};
|
2019-02-07 16:37:40 +01:00
|
|
|
}
|
2019-01-21 15:08:22 +01:00
|
|
|
}
|
|
|
|
</script>
|