mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
Merge branch 'feat/past-events' into 'master'
feat: Show if an event is in the past See merge request les/gancio!51
This commit is contained in:
commit
0e4468a31d
1 changed files with 16 additions and 7 deletions
|
@ -1,10 +1,10 @@
|
|||
<template>
|
||||
<article class='h-event' itemscope itemtype="https://schema.org/Event">
|
||||
<article class='h-event' :class="{ 'is-past': isPast }" itemscope itemtype="https://schema.org/Event">
|
||||
|
||||
|
||||
<nuxt-link :to='`/event/${event.slug || event.id}`' itemprop="url">
|
||||
<MyPicture v-if='!hide_thumbs' :event='event' thumb :lazy='lazy' />
|
||||
<v-icon class='float-right mr-1' v-if='event.parentId' color='success' v-text='mdiRepeat' />
|
||||
<v-icon class='float-right mt-1 mr-1' v-if='event.parentId' color='success' v-text='mdiRepeat' />
|
||||
<v-icon class='float-right mt-1 mr-1' v-if='isPast' color='warning' v-text='mdiTimerSandComplete'/>
|
||||
<h1 class='title p-name' itemprop="name">{{ event.title }}</h1>
|
||||
</nuxt-link>
|
||||
|
||||
|
@ -25,7 +25,6 @@
|
|||
<span itemprop='name'>{{ event.place.name }}</span>
|
||||
</nuxt-link>
|
||||
<div class='d-none' itemprop='address'>{{ event.place.address }}</div>
|
||||
|
||||
</v-card-text>
|
||||
|
||||
<v-card-actions class='flex-wrap'>
|
||||
|
@ -38,11 +37,11 @@
|
|||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import MyPicture from '~/components/MyPicture'
|
||||
import { mdiRepeat, mdiCalendar, mdiMapMarker } from '@mdi/js'
|
||||
import { mdiRepeat, mdiCalendar, mdiMapMarker, mdiTimerSandComplete } from '@mdi/js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return { mdiRepeat, mdiMapMarker, mdiCalendar }
|
||||
return { mdiRepeat, mdiMapMarker, mdiCalendar, mdiTimerSandComplete }
|
||||
},
|
||||
components: {
|
||||
MyPicture
|
||||
|
@ -51,6 +50,16 @@ export default {
|
|||
event: { type: Object, default: () => ({}) },
|
||||
lazy: Boolean
|
||||
},
|
||||
computed: mapGetters(['hide_thumbs'])
|
||||
computed: {
|
||||
...mapGetters(['hide_thumbs']),
|
||||
isPast() {
|
||||
const now = new Date()
|
||||
if (this.event.end_datetime) {
|
||||
return new Date(this.event.end_datetime*1000) < now
|
||||
} else {
|
||||
return new Date((3*60*60+this.event.start_datetime)*1000) < now
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue