diff --git a/.gitignore b/.gitignore index 4c576367..02e7389e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ _*.js config*.json tests/seeds/testdb.sqlite -preso.md gancio.sqlite db.sqlite releases diff --git a/CHANGELOG b/CHANGELOG index 954e339d..0a7c66d2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,14 @@ All notable changes to this project will be documented in this file. +### 1.5.4 - 6 set '22 + - Update webcomponent deps + - Refactor datime display in webcomponent + - Force flyer download + - Restore range events on calendar + - Fix limit/max events for mariadb #183 + - Fix endtime selection + - Fix microdata address + ### 1.5.3 - 30 aug '22 - Fix end time selection when it's in the next day diff --git a/assets/helper.js b/assets/helper.js index 4b7c2185..2643d27e 100644 --- a/assets/helper.js +++ b/assets/helper.js @@ -1,31 +1,45 @@ import dayjs from 'dayjs' -export function attributesFromEvents (_events) { +export function attributesFromEvents(_events) { // const colors = ['teal', 'green', 'yellow', 'teal', 'indigo', 'green', 'red', 'purple', 'pink', 'gray'] // merge events with same date let attributes = [] const now = dayjs().unix() - for(let e of _events) { + for (let e of _events) { const key = dayjs.unix(e.start_datetime).tz().format('YYYYMMDD') - const c = e.start_datetime < now ? 'vc-past' : '' + const c = (e.end_datetime || e.start_datetime) < now ? 'vc-past' : '' + + if (e.multidate) { + attributes.push({ + dates: { start: new Date(e.start_datetime * 1000), end: new Date(e.end_datetime * 1000) }, + highlight: { + start: { fillMode: 'outline' }, + base: { fillMode: 'light' }, + end: { fillMode: 'outline' }, + } + }) + continue + } const i = attributes.find(a => a.day === key) if (!i) { - attributes.push({ day: key, key: e.id, n: 1, dates: new Date(e.start_datetime * 1000), - dot: { color: 'teal', class: c } }) + attributes.push({ + day: key, key: e.id, n: 1, dates: new Date(e.start_datetime * 1000), + dot: { color: 'teal', class: c } + }) continue } i.n++ - if (i.n >= 20 ) { + if (i.n >= 20) { i.dot = { color: 'purple', class: c } - } else if ( i.n >= 10 ) { - i.dot = { color: 'red', class: c} - } else if ( i.n >= 5 ) { - i.dot = { color: 'orange', class: c} - } else if ( i.n >= 3 ) { - i.dot = { color: 'yellow', class: c} + } else if (i.n >= 10) { + i.dot = { color: 'red', class: c } + } else if (i.n >= 5) { + i.dot = { color: 'orange', class: c } + } else if (i.n >= 3) { + i.dot = { color: 'yellow', class: c } } else { i.dot = { color: 'teal', class: c } } diff --git a/components/DateInput.vue b/components/DateInput.vue index f03279ba..7ba78919 100644 --- a/components/DateInput.vue +++ b/components/DateInput.vue @@ -272,7 +272,7 @@ export default { this.$emit('input', { ...this.value, from, due }) } else { let from = value - let due = this.value.due || from + let due = this.value.due if (this.fromHour) { const [hour, minute] = this.fromHour.split(':') from = dayjs.tz(value).hour(hour).minute(minute).second(0).toDate() diff --git a/components/Event.vue b/components/Event.vue index e3aae44f..d41eb02e 100644 --- a/components/Event.vue +++ b/components/Event.vue @@ -3,22 +3,22 @@ v-card.h-event.event.d-flex(itemscope itemtype="https://schema.org/Event") nuxt-link(:to='`/event/${event.slug || event.id}`' itemprop="url") MyPicture(:event='event' thumb :lazy='lazy') v-icon.float-right.mr-1(v-if='event.parentId' color='success' v-text='mdiRepeat') - .title.p-name(itemprop="name") {{event.title}} + .title.p-name(itemprop="name") {{ event.title }} v-card-text.body.pt-0.pb-0 - time.dt-start.subtitle-1(:datetime='event.start_datetime|unixFormat("YYYY-MM-DD HH:mm")' itemprop="startDate" :content="event.start_datetime|unixFormat('YYYY-MM-DDTHH:mm')") {{ event|when }} - .d-none.dt-end(itemprop="endDate" :content="event.end_datetime|unixFormat('YYYY-MM-DDTHH:mm')") {{event.end_datetime|unixFormat('YYYY-MM-DD HH:mm')}} - nuxt-link.place.d-block.p-location.pl-0(text color='primary' :to='`/place/${event.place.name}`' itemprop="location" :content="event.place.name") {{event.place.name}} - .d-none(itemprop='location.address') {{event.place.address}} + time.dt-start.subtitle-1(:datetime='event.start_datetime | unixFormat("YYYY-MM-DD HH:mm")' itemprop="startDate" :content="event.start_datetime | unixFormat('YYYY-MM-DDTHH:mm')") {{ event | when }} + .d-none.dt-end(itemprop="endDate" :content="event.end_datetime | unixFormat('YYYY-MM-DDTHH:mm')") {{ event.end_datetime | unixFormat('YYYY-MM-DD HH:mm') }} + nuxt-link.place.d-block.p-location.pl-0(text color='primary' :to='`/place/${event.place.name}`' itemprop="location" itemscope itemtype="https://schema.org/Place") {{ event.place.name }} + .d-none(itemprop='address') {{ event.place.address }} v-card-actions.pt-0.actions.justify-space-between .tags - v-chip.ml-1.mt-1(v-for='tag in event.tags.slice(0,6)' small :to='`/tag/${tag}`' - :key='tag' outlined color='primary') {{tag}} + v-chip.ml-1.mt-1(v-for='tag in event.tags.slice(0, 6)' small :to='`/tag/${tag}`' + :key='tag' outlined color='primary') {{ tag }} client-only v-menu(offset-y eager) - template(v-slot:activator="{on}") + template(v-slot:activator="{ on }") v-btn.align-self-end(icon v-on='on' color='primary' title='more' aria-label='more') v-icon(v-text='mdiDotsVertical') v-list(dense) @@ -27,22 +27,22 @@ v-card.h-event.event.d-flex(itemscope itemtype="https://schema.org/Event") v-list-item-icon v-icon(v-text='mdiContentCopy') v-list-item-content - v-list-item-title {{$t('common.copy_link')}} + v-list-item-title {{ $t('common.copy_link') }} v-list-item(:href='`/api/event/${event.slug || event.id}.ics`') v-list-item-icon v-icon(v-text='mdiCalendarExport') v-list-item-content - v-list-item-title {{$t('common.add_to_calendar')}} + v-list-item-title {{ $t('common.add_to_calendar') }} v-list-item(v-if='is_mine' :to='`/add/${event.id}`') v-list-item-icon v-icon(v-text='mdiPencil') v-list-item-content - v-list-item-title {{$t('common.edit')}} + v-list-item-title {{ $t('common.edit') }} v-list-item(v-if='is_mine' @click='remove(false)') v-list-item-icon v-icon(color='error' v-text='mdiDeleteForever') v-list-item-content - v-list-item-title {{$t('common.remove')}} + v-list-item-title {{ $t('common.remove') }} template(#placeholder) v-btn.align-self-end(icon color='primary' aria-label='more') v-icon(v-text='mdiDotsVertical') @@ -51,13 +51,17 @@ v-card.h-event.event.d-flex(itemscope itemtype="https://schema.org/Event") import { mapState } from 'vuex' import clipboard from '../assets/clipboard' import MyPicture from '~/components/MyPicture' -import { mdiRepeat, mdiPencil, mdiDotsVertical, mdiContentCopy, - mdiCalendarExport, mdiDeleteForever, mdiCalendar, mdiMapMarker } from '@mdi/js' +import { + mdiRepeat, mdiPencil, mdiDotsVertical, mdiContentCopy, + mdiCalendarExport, mdiDeleteForever, mdiCalendar, mdiMapMarker +} from '@mdi/js' export default { - data () { - return { mdiRepeat, mdiPencil, mdiDotsVertical, mdiContentCopy, mdiCalendarExport, - mdiDeleteForever, mdiMapMarker, mdiCalendar } + data() { + return { + mdiRepeat, mdiPencil, mdiDotsVertical, mdiContentCopy, mdiCalendarExport, + mdiDeleteForever, mdiMapMarker, mdiCalendar + } }, components: { MyPicture @@ -69,7 +73,7 @@ export default { mixins: [clipboard], computed: { ...mapState(['settings']), - is_mine () { + is_mine() { if (!this.$auth.user) { return false } @@ -79,13 +83,13 @@ export default { } }, methods: { - async remove () { + async remove() { const ret = await this.$root.$confirm('event.remove_confirmation') if (!ret) { return } await this.$axios.delete(`/event/${this.event.id}`) this.$emit('destroy', this.event.id) this.$root.$message('admin.event_remove_ok') - + } } } diff --git a/components/admin/Announcement.vue b/components/admin/Announcement.vue index b04559e2..07f78450 100644 --- a/components/admin/Announcement.vue +++ b/components/admin/Announcement.vue @@ -1,10 +1,10 @@ \ No newline at end of file + diff --git a/components/admin/Places.vue b/components/admin/Places.vue index 4e9b0d14..57a2d010 100644 --- a/components/admin/Places.vue +++ b/components/admin/Places.vue @@ -1,6 +1,6 @@