This commit is contained in:
lesion
2019-03-02 00:02:13 +01:00
parent b50a9a250c
commit f3dab2d315
7 changed files with 44 additions and 31 deletions

View File

@@ -10,6 +10,7 @@
import { mapState, mapActions } from 'vuex'
import filters from '@/filters'
import moment from 'moment'
import { intersection } from 'lodash'
export default {
name: 'Calendar',
@@ -58,7 +59,21 @@ export default {
}
},
computed: {
...mapState(['events', 'tags']),
filteredEvents () {
if (!this.filters.tags.length && !this.filters.places.length) return this.events
return this.events.filter(e => {
if (this.filters.tags.length) {
const m = intersection(e.tags.map(t => t.tag), this.filters.tags)
if (m.length>0) return true
}
if (this.filters.places.length) {
if (this.filters.places.find(p => p === e.place.name))
return true
}
return 0
})
},
...mapState(['events', 'tags', 'filters']),
attributes () {
return [
{ key: 'todaly', dates: new Date(),
@@ -67,7 +82,7 @@ export default {
},
popover: {label: this.$t('Today')}
},
...this.events.map(this.eventToAttribute)
...this.filteredEvents.map(this.eventToAttribute)
]
}
}

View File

@@ -2,7 +2,7 @@
b-card(bg-variant='dark' text-variant='white'
@click='$router.push("/event/" + event.id)'
:img-src='imgPath')
h4 {{event.title}}
h5 {{event.title}}
div <v-icon name='clock'/> {{event.start_datetime|datetime}}
span(v-b-popover.hover="event.place && event.place.address || ''") <v-icon name='map-marker-alt'/> {{event.place.name}}
br

View File

@@ -29,7 +29,6 @@
img(v-if='event.image_path' slot="aside" :src="imgPath(event)" alt="Media Aside" style='max-height: 60px')
small.float-right {{event.start_datetime|short_datetime}}
h5.mb-1 {{event.title}}
small.mb-1 {{event.description}}
b-badge.float-right.ml-1(v-for='tag in event.tags') {{tag.tag}}
small.float-right(v-b-popover.hover='event.place.address') {{event.place.name}}
Calendar(v-else)

View File

@@ -19,7 +19,7 @@
div
b-badge.mr-1(@click="removeSelected(sel)"
v-for="sel in selectedLabel"
:key="sel") {{sel}}
:key="sel") <v-icon color='orange' name='times' /> {{sel}}
b-list-group.groupMenu(v-show='showDropdown')
b-list-group-item(:key="$index" v-for="(item, $index) in matched"