diff --git a/components/Calendar.vue b/components/Calendar.vue index 71f81443..cc607e95 100644 --- a/components/Calendar.vue +++ b/components/Calendar.vue @@ -39,8 +39,8 @@ export default { }, }, computed: { - ...mapGetters(['filteredEvents']), - ...mapState(['tags']), + ...mapGetters(['filteredEventsWithPast']), + ...mapState(['tags', 'filters']), attributes () { const colors = ['indigo', 'orange', 'yellow', 'green', 'teal', 'blue', 'red', 'purple', 'pink', 'grey'] const tags = take(this.tags, 10).map(t=>t.tag) @@ -48,8 +48,9 @@ export default { let attributes = [] attributes.push ({ key: 'today', dates: new Date(), highlight: { color: 'green' }}) + const that = this function getColor(event) { - const color = { class: event.past ? 'past-event vc-rounded-full' : 'vc-rounded-full', color: 'blue' } + const color = { class: event.past && !that.filters.show_past_events ? 'past-event vc-rounded-full' : 'vc-rounded-full', color: 'blue' } const tag = get(event, 'tags[0].tag') if (!tag) return color const idx = tags.indexOf(tag) @@ -58,14 +59,14 @@ export default { return color } - attributes = attributes.concat(this.filteredEvents + attributes = attributes.concat(this.filteredEventsWithPast .filter(e => !e.multidate) .map(e => ({ key: e.id, dot: getColor(e), dates: new Date(e.start_datetime*1000)}))) - attributes = attributes.concat(this.filteredEvents + attributes = attributes.concat(this.filteredEventsWithPast .filter(e => e.multidate) .map( e => ({ key: e.id, highlight: getColor(e), dates: { start: new Date(e.start_datetime*1000), end: new Date(e.end_datetime*1000) }}))) diff --git a/components/Home.vue b/components/Home.vue index e487c8b8..b74a0c3d 100644 --- a/components/Home.vue +++ b/components/Home.vue @@ -9,7 +9,7 @@ Calendar .row.m-0 - .p-0.col-sm-6.col-lg-4.col-xl-3(v-for='event in filteredEvents' v-if='!event.past') + .p-0.col-sm-6.col-lg-4.col-xl-3(v-for='event in filteredEvents') a(:id='event.newDay' v-if='event.newDay') .d-block.d-sm-none el-divider {{event.start_datetime|day}} diff --git a/components/List.vue b/components/List.vue index 9c84f7fd..7a1706cf 100644 --- a/components/List.vue +++ b/components/List.vue @@ -4,7 +4,6 @@ div#list el-timeline el-timeline-item( v-for='event in events' - v-if='!event.past' :key='event.id' :timestamp='event|event_when' placement='top' icon='el-icon-arrow-down' size='large' diff --git a/pages/event/_id.vue b/pages/event/_id.vue index e68247f1..c4b6b813 100644 --- a/pages/event/_id.vue +++ b/pages/event/_id.vue @@ -1,5 +1,5 @@