gancio-upstream/components/Event.vue

79 lines
2.1 KiB
Vue
Raw Normal View History

2019-04-03 00:25:12 +02:00
<template lang="pug">
2020-07-28 12:24:39 +02:00
v-card.h-event.event.mt-1
2020-02-09 18:15:44 +01:00
nuxt-link(:to='`/event/${event.id}`')
2020-07-29 02:18:46 +02:00
v-img.align-end.white--text(:src="`/media/thumb/${event.image_path}`"
2020-10-09 00:39:33 +02:00
gradient="to bottom, rgba(0,0,0,.1), rgba(0,0,0,.7), rgba(0,0,0,.9)"
2020-07-29 02:18:46 +02:00
height="250" position="top top")
2020-10-09 00:39:33 +02:00
v-card-title.text-h5 {{event.title}}
2020-10-07 13:03:15 +02:00
2020-07-28 12:24:39 +02:00
v-card-text
2020-10-25 00:30:28 +02:00
2020-10-09 00:39:33 +02:00
time.text-h6(:datetime='event.start_datetime|unixFormat("YYYY-MM-DD HH:mm")') <v-icon>mdi-event</v-icon> {{ event|when }}
2020-10-17 00:41:21 +02:00
v-btn.d-block.text-h6(text color='primary' big @click="$emit('placeclick', event.place.id)") <v-icon>mdi-map-marker</v-icon> {{event.place.name}}
2020-10-07 13:03:15 +02:00
2020-07-25 21:41:22 +02:00
v-card-actions
2020-10-07 13:03:15 +02:00
v-chip.ml-1(v-for='tag in event.tags' link
2020-10-17 00:41:21 +02:00
:key='tag' outlined color='primary' @click="$emit('tagclick',tag)") {{tag}}
2020-07-25 21:41:22 +02:00
v-spacer
2020-10-07 13:03:15 +02:00
2020-07-29 02:18:46 +02:00
v-menu(offset-y)
template(v-slot:activator="{on}")
v-btn(icon v-on='on' color='primary')
v-icon mdi-dots-vertical
v-list
v-list-item
v-list-item-title test
2020-02-09 18:15:44 +01:00
2019-04-03 00:25:12 +02:00
</template>
<script>
2020-02-09 18:15:44 +01:00
import { mapState, mapActions } from 'vuex'
2019-04-03 00:25:12 +02:00
export default {
2019-05-30 12:04:14 +02:00
props: {
event: { type: Object, default: () => ({}) },
2019-04-03 00:25:12 +02:00
},
2019-05-30 12:04:14 +02:00
computed: {
2020-10-17 00:41:21 +02:00
...mapState(['settings']),
2020-02-09 18:15:44 +01:00
show_footer () {
return (this.event.tags.length || this.event.resources.length)
}
},
methods: {
...mapActions(['setSearchTags', 'setSearchPlaces']),
addTag (tag) {
if (this.filters.tags.includes(tag)) {
this.setSearchTags(this.filters.tags.filter(t => t !== tag))
} else {
this.setSearchTags(this.filters.tags.concat([tag]))
}
},
addPlace () {
const place = this.event.place.id
if (this.filters.places.includes(place)) {
this.setSearchPlaces(this.filters.places.filter(p => p !== place))
} else {
this.setSearchPlaces(this.filters.places.concat(place))
}
}
2019-04-03 00:25:12 +02:00
}
}
</script>
2020-07-25 21:41:22 +02:00
<style lang="less" scoped>
2020-07-28 12:24:39 +02:00
.event {
2020-07-31 01:03:19 +02:00
width: 330px;
2020-07-25 21:41:22 +02:00
max-width: 450px;
flex-grow: 1;
margin: .2em;
2020-07-28 12:24:39 +02:00
// background-color: #202020;
// overflow: hidden;
.title {
line-height: 1.2em;
max-height: 2.4em;
overflow: hidden;
}
a {
text-decoration: none;
}
2020-07-25 21:41:22 +02:00
}
2020-10-07 13:03:15 +02:00
</style>