gancio-upstream/components/Event.vue

139 lines
2.5 KiB
Vue
Raw Normal View History

2019-04-03 00:25:12 +02:00
<template lang="pug">
2019-05-30 12:04:14 +02:00
nuxt-link.event(:to='`event/${event.id}`' :class='{ withImg: event.image_path }')
//- image
img(v-if='showImage && event.image_path' :src='`/media/thumb/${event.image_path}`')
.event-info
.content-info
//- title
h2 {{event.title}}
//- date / place
.date
div {{event|event_when}}
2019-06-06 23:54:32 +02:00
div @{{event.place.name}}
2019-05-30 12:04:14 +02:00
//- p(v-if='showDescription') {{event.description}}
//- div(v-if='event.comments && event.comments.length')
//- v-icon(name='comments' color='dark')
//- span {{event.comments.length}} {{$t('common.comments')}}
ul.tags(v-if='showTags && event.tags')
li(v-for='tag in event.tags' :key='tag.tag') {{tag.tag}}
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-04-03 00:25:12 +02:00
},
2019-05-30 12:04:14 +02:00
showDescription: {
type: Boolean,
default: true
},
selected: {
type: Boolean,
default: false
2019-04-03 00:25:12 +02:00
}
},
2019-05-30 12:04:14 +02:00
computed: {
date () {
return new Date(this.event.start_datetime).getDate()
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%;
max-height: 200px;
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-06 23:54:32 +02:00
font-weight: 300;
font-size: 12px;
font-size: 0.95rem;
color: #ff917a;
2019-05-30 12:04:14 +02:00
}
}
.tags {
font-size: 12px;
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;
color: rgba(255,255,255,0.7);
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>