diff --git a/components/admin/Places.vue b/components/admin/Places.vue index 4fab04e9..91405256 100644 --- a/components/admin/Places.vue +++ b/components/admin/Places.vue @@ -19,23 +19,23 @@ v-container v-model='place.name' :placeholder='$t("common.name")') - v-text-field( - :rules="[$validators.required('common.address')]" + v-combobox(ref='address' + :prepend-icon='mdiMapSearch' + @input.native='searchAddress' :label="$t('common.address')" - v-model='place.address' - :placeholder='$t("common.address")') - - v-text-field(v-if="settings.allow_geolocation" - :rules="[$validators.required('common.latitude')]" - :label="$t('common.latitude')" - v-model='place.latitude' - :placeholder='$t("common.latitude")') - - v-text-field(v-if="settings.allow_geolocation" - :rules="[$validators.required('common.longitude')]" - :label="$t('common.longitude')" - v-model='place.longitude' - :placeholder='$t("common.longitude")') + :rules="[ v => $validators.required('common.address')(v)]" + :value='place.address' + persistent-hint hide-no-data clearable no-filter + :loading='loading' + @change='selectAddress' + @focus='searchAddress' + :items="addressList" + :hint="$t('event.address_description')") + template(v-slot:item="{ item, attrs, on }") + v-list-item(v-bind='attrs' v-on='on') + v-list-item-content(two-line v-if='item') + v-list-item-title(v-text='item.name') + v-list-item-subtitle(v-text='`${item.address}`') v-card-actions @@ -51,6 +51,8 @@ v-container :hide-default-footer='places.length < 5' :footer-props='{ prevIcon: mdiChevronLeft, nextIcon: mdiChevronRight }' :search='search') + template(v-slot:item.map='{ item }') + span {{item.latitude && item.longitude && 'YEP' }} template(v-slot:item.actions='{ item }') v-btn(@click='editPlace(item)' color='primary' icon) v-icon(v-text='mdiPencil') @@ -59,22 +61,27 @@ v-container