gancio-upstream/components/Event.vue

122 lines
2.2 KiB
Vue

<template lang="pug">
nuxt-link.event(:to='`/event/${event.id}`' :class='{ withImg: event.image_path }')
//- image
el-image(v-if='showImage && event.image_path' lazy :src='`/media/thumb/${event.image_path}`')
.event-info
.content-info
//- title
h2 {{event.title}}
//- date / place
.date
div <v-icon name='clock'/> {{event|when('home')}}
div <v-icon name='map-marker-alt' /> {{event.place.name}}
ul.tags(v-if='showTags && event.tags')
li(v-for='tag in event.tags' :key='tag') {{tag}}
li(v-if='settings.enable_federation && event.resources && event.resources.length') <u>{{$tc('common.n_resources', event.resources.length)}}</u>
</template>
<script>
import { mapState } from 'vuex'
export default {
props: {
event: { type: Object, default: () => ({}) },
showTags: {
type: Boolean,
default: true
},
showImage: {
type: Boolean,
default: true
}
},
computed: {
...mapState(['settings'])
}
}
</script>
<style lang='less'>
@media only screen and (min-width: 574px) {
.event {
height: 100%;
}
}
.event {
padding: 3px;
display: flex;
flex-direction: column;
// height: 100%;
&:hover {
text-decoration: none;
}
img {
width: 100%;
max-height: 250px;
object-fit: cover;
object-position: top;
}
.event-info {
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
background-color: #111214;
}
.content-info {
padding: 0.8em 1em;
h2 {
color: rgb(174, 255, 174);
font-size: 16px;
font-size: 1.1rem;
font-weight: 600;
margin: 0px;
}
p {
max-height: 92px;
overflow: hidden;
color: white;
margin: 0px;
}
.date {
font-weight: 400;
font-size: 1rem;
color: white;
}
}
.tags {
font-size: 15px;
padding: 1px;
margin-bottom: 0;
display:flex;
flex-wrap: wrap;
justify-content: center;
li {
background: #1B1F21;
display: inline-block;
padding: 2px 10px;
color: rgba(255,255,255,0.9);
margin: 1px;
text-align: center;
flex-grow: 1;
}
}
}
</style>