move event.locations to more unique event.online_locations, various fixes on insertion workflow, improved locale messages

This commit is contained in:
sedum
2023-02-22 03:11:58 +01:00
parent 3ca86b9a3b
commit cff608c06f
11 changed files with 105 additions and 102 deletions

View File

@@ -127,7 +127,7 @@ export default {
data.event.place.address = event.place.address || ''
data.event.place.latitude = event.place.latitude || ''
data.event.place.longitude = event.place.longitude || ''
data.event.locations = event.locations || []
data.event.online_locations = event.online_locations || []
const from = dayjs.unix(event.start_datetime).tz()
const due = event.end_datetime && dayjs.unix(event.end_datetime).tz()
data.date = {
@@ -157,7 +157,7 @@ export default {
openImportDialog: false,
event: {
place: { name: '', address: '', latitude: null, longitude: null },
locations: [],
online_locations: [],
title: '',
description: '',
tags: [],
@@ -245,12 +245,8 @@ export default {
formData.append('place_longitude', this.event.place.longitude || '')
}
if (this.event.locations.length) {
this.event.locations.forEach(location => formData.append('locations[]', location.url))
} else {
// delete
this.event.locations = []
formData.append('locations', this.event.locations )
if (this.event.online_locations) {
this.event.online_locations.forEach(l => formData.append('online_locations[]', l))
}
formData.append('description', this.event.description)

View File

@@ -37,19 +37,19 @@ v-container#event.pa-0.pa-sm-2
outlined :key='tag' :to='`/tag/${encodeURIComponent(tag)}`') {{tag}}
//- online events
v-divider(v-if='onlineSectionEnabled && event.locations && event.locations.length')
div(v-if='onlineSectionEnabled && event.locations && event.locations.length')
v-divider(v-if='onlineSectionEnabled && event.online_locations && event.online_locations.length')
div(v-if='onlineSectionEnabled && event.online_locations && event.online_locations.length')
v-card-text.text-caption.pb-0(v-text="event.place.name === 'online' && $t('event.event_only_online') || $t('event.event_also_online') ")
v-list-item(target='_blank' :href='`${event.locations[0]}`')
v-list-item(target='_blank' :href='`${event.online_locations[0]}`')
v-list-item-icon
v-icon.my-auto(v-text='mdiMonitorAccount')
v-list-item-content.py-0
v-list-item-title.text-caption(v-text='`${event.locations[0]}`')
div(v-if='onlineSectionEnabled && event.locations && event.locations.length > 1')
v-list-item-title.text-caption(v-text='`${event.online_locations[0]}`')
div(v-if='onlineSectionEnabled && event.online_locations && event.online_locations.length > 1')
v-card-text.text-caption.pt-0.pb-0(v-text="$t('event.online_locations_fallback_urls')")
v-list-item
v-list-item-content
v-chip(v-for='(item, index) in event.locations' v-if="index > 0" target='_blank' :href="`${item}`"
v-chip(v-for='(item, index) in event.online_locations' v-if="index > 0" target='_blank' :href="`${item}`"
v-bind:key="index" small label v-text="`${item}`" outlined )
v-divider