Merge remote-tracking branch 'sedum/feat/geolocation'

This commit is contained in:
lesion 2022-12-11 01:14:04 +01:00
commit f8c4f9467e
No known key found for this signature in database
GPG key ID: 352918250B012177
2 changed files with 21 additions and 17 deletions

View file

@ -22,16 +22,19 @@ v-row.mb-4
v-list-item-title(v-text='item.name')
v-list-item-subtitle(v-text='item.address')
//- v-text-field(
//- ref='address'
//- :prepend-icon='mdiMap'
//- :disabled='disableAddress'
//- :rules="[ v => disableAddress ? true : $validators.required('common.address')(v)]"
//- :label="$t('common.address')"
//- @change="changeAddress"
//- :value="value.address")
v-col(cols=12 md=6)
v-combobox(ref='address'
v-text-field(v-if="!settings.allow_geolocation"
ref='address'
:prepend-icon='mdiMap'
:disabled='disableAddress'
:rules="[ v => disableAddress ? true : $validators.required('common.address')(v)]"
:label="$t('common.address')"
:hint="$t('event.address_description')"
persistent-hint
@change="changeAddress"
:value="value.address")
v-combobox(ref='address' v-else
:prepend-icon='mdiMapSearch'
:disabled='disableAddress'
@input.native='searchAddress'
@ -44,7 +47,7 @@ v-row.mb-4
@change='selectAddress'
@focus='searchAddress'
:items="addressList"
:hint="$t('event.address_description' + (settings.allow_geolocation && '_osm'))")
:hint="$t('event.address_description_osm')")
template(v-slot:message="{message, key}")
span(v-html='message' :key="key")
template(v-slot:item="{ item, attrs, on }")
@ -182,11 +185,11 @@ export default {
}
this.$emit('input', { ...this.place })
},
// changeAddress (v) {
// this.place.address = v
// this.$emit('input', { ...this.place })
// this.disableDetails = false
// },
changeAddress (v) {
this.place.address = v
this.$emit('input', { ...this.place })
this.disableDetails = false
},
selectAddress (v) {
if (!v) { return }
if (typeof v === 'object') {

View file

@ -101,9 +101,9 @@ export default {
if (params.edit && !store.state.auth.loggedIn) {
return error({ statusCode: 401, message: 'Not allowed'})
}
return true
},
async asyncData({ params, $axios, error, $auth, store }) {
if (params.edit) {
@ -179,6 +179,7 @@ export default {
filteredTags() {
if (!this.tagName) { return this.tags.slice(0, 10).map(t => t.tag) }
const tagName = this.tagName.trim().toLowerCase()
console.log(tagName)
return this.tags.filter(t => t.tag.toLowerCase().includes(tagName)).map(t => t.tag)
}
},