gancio-upstream/components/Event.vue

133 lines
2.4 KiB
Vue
Raw Normal View History

2019-04-03 00:25:12 +02:00
<template lang="pug">
2019-10-26 00:40:13 +02:00
nuxt-link.event(:to='`/event/${link}`' :class='{ withImg: event.image_path }')
2019-08-25 14:28:06 +02:00
//- image
img(v-if='showImage && event.image_path' :src='`/media/thumb/${event.image_path}`')
2019-05-30 12:04:14 +02:00
.event-info
.content-info
2019-05-30 12:04:14 +02:00
//- title
h2 {{event.title}}
2019-05-30 12:04:14 +02:00
//- date / place
.date
div <v-icon name='clock'/> {{event|when('home')}}
div <v-icon name='map-marker-alt' /> {{event.place.name}}
2019-05-30 12:04:14 +02:00
ul.tags(v-if='showTags && event.tags')
li(v-for='tag in event.tags' :key='tag') {{tag}}
li(v-if='settings.enable_federation && event.comments && event.comments.length') <u>{{$tc('common.resources', event.comments.length)}}</u>
2019-04-03 00:25:12 +02:00
</template>
<script>
import { mapState, mapActions } from 'vuex'
export default {
2019-05-30 12:04:14 +02:00
props: {
event: Object,
showTags: {
type: Boolean,
default: true
},
showImage: {
type: Boolean,
default: true
2019-09-11 19:12:24 +02:00
}
2019-04-03 00:25:12 +02:00
},
2019-05-30 12:04:14 +02:00
computed: {
2019-09-12 11:59:30 +02:00
...mapState(['settings']),
2019-09-11 19:12:24 +02:00
date () {
2019-05-30 12:04:14 +02:00
return new Date(this.event.start_datetime).getDate()
2019-07-23 15:58:28 +02:00
},
link () {
if (this.event.recurrent) {
2019-07-27 13:05:02 +02:00
return `${this.event.id}_${this.event.start_datetime}`
2019-07-23 15:58:28 +02:00
}
return this.event.id
2019-04-03 00:25:12 +02:00
}
}
}
</script>
2019-05-30 12:04:14 +02:00
<style lang='less'>
2019-06-06 23:54:32 +02:00
@import '../assets/style.less';
2019-04-03 00:25:12 +02:00
2019-05-30 12:04:14 +02:00
@media only screen and (min-width: 574px) {
.event {
height: 100%;
}
2019-04-03 00:25:12 +02:00
}
2019-05-30 12:04:14 +02:00
.event {
padding: 3px;
display: flex;
flex-direction: column;
2019-04-03 00:25:12 +02:00
2019-05-30 12:04:14 +02:00
// height: 100%;
&:hover {
text-decoration: none;
}
2019-04-03 00:25:12 +02:00
2019-05-30 12:04:14 +02:00
img {
width: 100%;
2019-06-09 00:45:50 +02:00
max-height: 250px;
2019-05-30 12:04:14 +02:00
object-fit: cover;
object-position: top;
}
2019-04-03 00:25:12 +02:00
2019-05-30 12:04:14 +02:00
.event-info {
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
2019-06-06 23:54:32 +02:00
background-color: #111214;
2019-05-30 12:04:14 +02:00
}
.content-info {
padding: 0.8em 1em;
h2 {
2019-06-06 23:54:32 +02:00
color: @success;
2019-05-30 12:04:14 +02:00
font-size: 16px;
2019-06-06 23:54:32 +02:00
font-size: 1.2rem;
font-weight: 400;
2019-05-30 12:04:14 +02:00
margin: 0px;
}
p {
max-height: 92px;
overflow: hidden;
color: white;
margin: 0px;
}
.date {
2019-06-09 00:45:50 +02:00
font-weight: 400;
2019-06-09 01:53:24 +02:00
font-size: 1rem;
color: white;
2019-09-11 19:12:24 +02:00
}
2019-05-30 12:04:14 +02:00
}
.tags {
2019-06-09 01:53:24 +02:00
font-size: 15px;
2019-05-30 12:04:14 +02:00
padding: 1px;
margin-bottom: 0;
display:flex;
flex-wrap: wrap;
justify-content: center;
li {
2019-06-06 23:54:32 +02:00
background: #1B1F21;
2019-05-30 12:04:14 +02:00
display: inline-block;
padding: 2px 10px;
2019-06-09 00:45:50 +02:00
color: rgba(255,255,255,0.9);
2019-05-30 12:04:14 +02:00
margin: 1px;
text-align: center;
flex-grow: 1;
}
}
2019-04-03 00:25:12 +02:00
}
2019-05-30 12:04:14 +02:00
2019-04-03 00:25:12 +02:00
</style>