From 03b563971bfd28037aab26931b7320231c183052 Mon Sep 17 00:00:00 2001 From: lesion Date: Sat, 13 Jul 2019 01:02:11 +0200 Subject: [PATCH] keep going with recurrent event --- components/Calendar.vue | 8 ++--- components/Event.vue | 2 +- components/Home.vue | 1 + pages/add/_edit.vue | 50 ++++++++++++++++++--------- pages/admin.vue | 15 ++++++++ plugins/filters.js | 6 ++-- server/api/controller/bot.js | 2 +- server/api/controller/event.js | 57 +++++++++++++++++-------------- server/api/controller/settings.js | 4 +-- server/api/controller/user.js | 3 +- server/emails/event/html.pug | 2 +- server/emails/event/subject.pug | 2 +- server/notifier.js | 15 ++------ store/index.js | 10 ++++-- views/feed/rss.pug | 4 +-- 15 files changed, 109 insertions(+), 72 deletions(-) diff --git a/components/Calendar.vue b/components/Calendar.vue index cc607e95..a33555dc 100644 --- a/components/Calendar.vue +++ b/components/Calendar.vue @@ -43,7 +43,7 @@ export default { ...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) + const tags = take(this.tags, 10)//.map(t=>t.tag) // const tags = [this.tags[0].tag, this.tags[1].tag, this.tags[2].tag, this.tags[3].tag, this.tags[4].tag, this.tags[5].tag ] let attributes = [] attributes.push ({ key: 'today', dates: new Date(), highlight: { color: 'green' }}) @@ -51,7 +51,7 @@ export default { const that = this function getColor(event) { 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') + const tag = get(event, 'tags[0]') if (!tag) return color const idx = tags.indexOf(tag) if (idx<0) return color @@ -64,12 +64,12 @@ export default { .map(e => ({ key: e.id, dot: getColor(e), - dates: new Date(e.start_datetime*1000)}))) + dates: new Date(e.start_datetime)}))) 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) }}))) + start: new Date(e.start_datetime), end: new Date(e.end_datetime) }}))) return attributes } diff --git a/components/Event.vue b/components/Event.vue index 74a13bc1..85a3677c 100644 --- a/components/Event.vue +++ b/components/Event.vue @@ -21,7 +21,7 @@ //- span {{event.comments.length}} {{$t('common.comments')}} ul.tags(v-if='showTags && event.tags') - li(v-for='tag in event.tags' :key='tag.tag') {{tag.tag}} + li(v-for='tag in event.tags' :key='tag') {{tag}}