2019-01-21 15:08:22 +01:00
|
|
|
<template>
|
2019-10-01 20:10:53 +02:00
|
|
|
<section class="container">
|
2020-02-18 08:57:00 +01:00
|
|
|
<h1>{{ $t("Event list") }}</h1>
|
2019-01-21 15:08:22 +01:00
|
|
|
<b-loading :active.sync="$apollo.loading"></b-loading>
|
|
|
|
<div v-if="events.length > 0" class="columns is-multiline">
|
|
|
|
<EventCard
|
|
|
|
v-for="event in events"
|
|
|
|
:key="event.uuid"
|
|
|
|
:event="event"
|
|
|
|
class="column is-one-quarter-desktop is-half-mobile"
|
|
|
|
/>
|
|
|
|
</div>
|
2020-11-30 10:24:11 +01:00
|
|
|
<b-message
|
|
|
|
v-if-else="events.length === 0 && $apollo.loading === false"
|
|
|
|
type="is-danger"
|
|
|
|
>{{ $t("No events found") }}</b-message
|
|
|
|
>
|
2019-01-21 15:08:22 +01:00
|
|
|
</section>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-01 15:57:07 +02:00
|
|
|
import { Component, Prop, Vue } from "vue-property-decorator";
|
2020-02-18 08:57:00 +01:00
|
|
|
import EventCard from "../../components/Event/EventCard.vue";
|
|
|
|
import RouteName from "../../router/name";
|
|
|
|
import { IEvent } from "../../types/event.model";
|
2019-02-22 14:55:47 +01:00
|
|
|
|
2019-01-21 15:08:22 +01:00
|
|
|
@Component({
|
|
|
|
components: {
|
2019-03-22 10:57:14 +01:00
|
|
|
EventCard,
|
|
|
|
},
|
2021-05-25 16:21:29 +02:00
|
|
|
metaInfo() {
|
|
|
|
return {
|
|
|
|
title: this.$t("Event list") as string,
|
|
|
|
};
|
|
|
|
},
|
2019-01-21 15:08:22 +01:00
|
|
|
})
|
|
|
|
export default class EventList extends Vue {
|
|
|
|
@Prop(String) location!: string;
|
|
|
|
|
|
|
|
events = [];
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2019-01-21 15:08:22 +01:00
|
|
|
loading = true;
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2019-01-21 15:08:22 +01:00
|
|
|
locationChip = false;
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
locationText = "";
|
2019-01-21 15:08:22 +01:00
|
|
|
|
2020-11-06 11:34:32 +01:00
|
|
|
viewEvent(event: IEvent): void {
|
2019-02-22 14:55:47 +01:00
|
|
|
this.$router.push({ name: RouteName.EVENT, params: { uuid: event.uuid } });
|
2019-01-21 15:08:22 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
2020-02-18 08:57:00 +01:00
|
|
|
<style scoped></style>
|