minor while edit event datetime
This commit is contained in:
parent
18be5664fd
commit
b413742c45
7 changed files with 36 additions and 13 deletions
|
@ -4,7 +4,7 @@ div#list
|
||||||
el-timeline
|
el-timeline
|
||||||
el-timeline-item(
|
el-timeline-item(
|
||||||
v-for='event in events'
|
v-for='event in events'
|
||||||
:key='event.start_datetime'
|
:key='`${event.id}_${event.start_datetime}`'
|
||||||
:timestamp='event|when'
|
:timestamp='event|when'
|
||||||
placement='top' icon='el-icon-arrow-down' size='large'
|
placement='top' icon='el-icon-arrow-down' size='large'
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,3 +8,14 @@
|
||||||
div(v-html='$t("about")')
|
div(v-html='$t("about")')
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
<script>
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
export default {
|
||||||
|
computed: mapState(['settings']),
|
||||||
|
head () {
|
||||||
|
return {
|
||||||
|
title: `${this.settings.title} - ${this.$t('common.info')}`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
|
@ -193,21 +193,22 @@ export default {
|
||||||
data.event.place.name = event.place.name
|
data.event.place.name = event.place.name
|
||||||
data.event.place.address = event.place.address || ''
|
data.event.place.address = event.place.address || ''
|
||||||
if (event.multidate) {
|
if (event.multidate) {
|
||||||
data.date = { start: new Date(event.start_datetime), end: new Date(event.end_datetime) }
|
data.date = { start: new Date(event.start_datetime*1000), end: new Date(event.end_datetime*1000) }
|
||||||
data.event.type = 'multidate'
|
data.event.type = 'multidate'
|
||||||
} else if (event.recurrent ) {
|
} else if (event.recurrent ) {
|
||||||
data.event.type = 'recurrent'
|
data.event.type = 'recurrent'
|
||||||
data.event.recurrent = JSON.parse(event.recurrent)
|
data.event.recurrent = JSON.parse(event.recurrent)
|
||||||
} else {
|
} else {
|
||||||
data.event.type = 'normal'
|
data.event.type = 'normal'
|
||||||
data.date = new Date(event.start_datetime)
|
data.date = new Date(event.start_datetime*1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
data.time.start = moment(event.start_datetime).format('HH:mm')
|
data.time.start = moment.unix(event.start_datetime).format('HH:mm')
|
||||||
data.time.end = moment(event.end_datetime).format('HH:mm')
|
data.time.end = moment.unix(event.end_datetime).format('HH:mm')
|
||||||
data.event.title = event.title
|
data.event.title = event.title
|
||||||
data.event.description = event.description.replace(/(<([^>]+)>)/ig, '')
|
data.event.description = event.description.replace(/(<([^>]+)>)/ig, '')
|
||||||
data.event.id = event.id
|
data.event.id = event.id
|
||||||
|
data.event.recurrent = {}
|
||||||
if (event.tags) {
|
if (event.tags) {
|
||||||
data.event.tags = event.tags.map(t => t.tag)
|
data.event.tags = event.tags.map(t => t.tag)
|
||||||
}
|
}
|
||||||
|
@ -254,11 +255,13 @@ export default {
|
||||||
date_start.isBefore(e.start_datime) && date_end.isAfter(e.start_datetime) :
|
date_start.isBefore(e.start_datime) && date_end.isAfter(e.start_datetime) :
|
||||||
date_start.isSame(e.start_datetime, 'day') || date_start.isSame(e.end_datetime) ||
|
date_start.isSame(e.start_datetime, 'day') || date_start.isSame(e.end_datetime) ||
|
||||||
date_start.isAfter(e.start_datetime) && date_start.isBefore(e.end_datetime))
|
date_start.isAfter(e.start_datetime) && date_start.isBefore(e.end_datetime))
|
||||||
|
} else if (this.event.type === 'recurrent' ) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
const date = moment(this.date)
|
const date = moment(this.date)
|
||||||
return this.events.filter(e =>
|
return this.events.filter(e =>
|
||||||
!e.multidate ?
|
!e.multidate ?
|
||||||
date.isSame(moment(e.start_datetime), 'day') :
|
!e.recurrent && date.isSame(moment(e.start_datetime), 'day') :
|
||||||
moment(e.start_datetime).isSame(date, 'day') ||
|
moment(e.start_datetime).isSame(date, 'day') ||
|
||||||
moment(e.start_datetime).isBefore(date) && moment(e.end_datetime).isAfter(date)
|
moment(e.start_datetime).isBefore(date) && moment(e.end_datetime).isAfter(date)
|
||||||
)
|
)
|
||||||
|
@ -402,7 +405,6 @@ export default {
|
||||||
end_datetime = end_datetime.add(1, 'day')
|
end_datetime = end_datetime.add(1, 'day')
|
||||||
}
|
}
|
||||||
formData.append('recurrent', JSON.stringify(recurrent))
|
formData.append('recurrent', JSON.stringify(recurrent))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.event.image) {
|
if (this.event.image) {
|
||||||
|
|
|
@ -94,6 +94,9 @@ export default {
|
||||||
open: true,
|
open: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
head () {
|
||||||
|
return { title: `${this.settings.title} - ${this.$t('common.admin')}` }
|
||||||
|
},
|
||||||
async mounted () {
|
async mounted () {
|
||||||
const code = this.$route.query.code
|
const code = this.$route.query.code
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,13 @@ export default {
|
||||||
password: '',
|
password: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
name: 'Settings',
|
||||||
|
computed: mapState(['settings']),
|
||||||
|
head () {
|
||||||
|
return {
|
||||||
|
title: `${this.settings.title} - ${this.$t('common.settings')}`
|
||||||
|
}
|
||||||
|
},
|
||||||
async asyncData ({ $axios, params }) {
|
async asyncData ({ $axios, params }) {
|
||||||
const user = await $axios.$get('/auth/user')
|
const user = await $axios.$get('/auth/user')
|
||||||
user.mastodon_auth = ''
|
user.mastodon_auth = ''
|
||||||
|
|
|
@ -47,7 +47,7 @@ module.exports = (sequelize, DataTypes) => {
|
||||||
attributedTo: `${config.baseurl}/federation/u/${username}`,
|
attributedTo: `${config.baseurl}/federation/u/${username}`,
|
||||||
to: 'https://www.w3.org/ns/activitystreams#Public',
|
to: 'https://www.w3.org/ns/activitystreams#Public',
|
||||||
cc: follower ? follower: [],
|
cc: follower ? follower: [],
|
||||||
content: this.title
|
content: `<b>${this.title}</b> @${this.place.name} <br/>${this.description.length > 200 ? this.description.substr(0, 200) + '...' : this.description} - ${this.tags.map(t => '#' + t.tag).join(' ')} <br/>${config.baseurl}/event/${this.id}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ const httpSignature = require('http-signature')
|
||||||
const actorCache = []
|
const actorCache = []
|
||||||
|
|
||||||
const Helpers = {
|
const Helpers = {
|
||||||
async signAndSend(message, user, to) {//, domain, req, res, targetOrigin) {
|
async signAndSend(message, user, to) {
|
||||||
|
|
||||||
// get the URI of the actor object and append 'inbox' to it
|
// get the URI of the actor object and append 'inbox' to it
|
||||||
const toInbox = to + '/inbox'
|
const toInbox = to + '/inbox'
|
||||||
|
|
Loading…
Reference in a new issue