major on recurrent events

This commit is contained in:
lesion
2019-07-23 01:31:43 +02:00
parent beab52d349
commit f9e0883eaf
19 changed files with 210 additions and 76 deletions

View File

@@ -1,5 +1,5 @@
<template lang="pug">
nuxt-link.event(:to='`event/${event.id}`' :class='{ withImg: event.image_path }')
nuxt-link.event(:to='`event/${event.id}${event.recurrent && "_" + event.start_datetime/1000}`' :class='{ withImg: event.image_path }')
//- image
img(v-if='showImage && event.image_path' :src='`/media/thumb/${event.image_path}`')
@@ -11,7 +11,7 @@
//- date / place
.date
div <v-icon name='clock'/> {{event|event_when}}
div <v-icon name='clock'/> {{event|when('home')}}
div <v-icon name='map-marker-alt' /> {{event.place.name}}
//- p(v-if='showDescription') {{event.description}}

View File

@@ -5,14 +5,14 @@ div#list
el-timeline-item(
v-for='event in events'
:key='event.id'
:timestamp='event|event_when'
:timestamp='event|when'
placement='top' icon='el-icon-arrow-down' size='large'
)
div.float-right
small @{{event.place.name}}
a(:href='"/event/" + event.id' target='_blank') {{event.title}}
a(:href='"/event/" + link(event)' target='_blank') {{event.title}}
hr
</template>
<script>
@@ -23,6 +23,14 @@ export default {
data () {
return { }
},
methods: {
link (event) {
if (event.recurrent) {
return `${event.id}_${event.start_datetime/1000}`
}
return event.id
}
},
props: {
title: {
type: String,

View File

@@ -7,14 +7,14 @@
//- v-model='onlyMine'
//- )
el-switch.mt-1.mb-1.ml-2.d-block(
v-if='pastFilter'
v-if='recurrentFilter && settings.allow_recurrent_event'
inactive-text=''
active-text='anche appuntamenti fissi'
inactive-color='lightgreen'
v-model='showRecurrent'
)
el-switch.mt-1.mb-1.ml-2.d-block(
v-if='recurrentFilter'
v-if='pastFilter'
inactive-text='solo futuri'
active-text='anche passati'
inactive-color='lightgreen'
@@ -45,7 +45,7 @@ export default {
},
methods: mapActions(['setSearchPlaces', 'setSearchTags', 'showPastEvents', 'showRecurrentEvents']),
computed: {
...mapState(['tags', 'places', 'filters']),
...mapState(['tags', 'places', 'filters', 'settings']),
// TOFIX: optimize
keywords () {
const tags = this.tags.map( t => ({ value: 't' + t.tag, label: t.tag, weigth: t.weigth }))