media improvement

This commit is contained in:
lesion
2022-04-27 12:34:58 +02:00
parent 35e44a8a80
commit 95b546afa9
10 changed files with 112 additions and 137 deletions

View File

@@ -15,7 +15,7 @@
v-col.col-12.col-sm-4
p {{$t('event.choose_focal_point')}}
img.img.d-none.d-sm-block(v-if='mediaPreview'
img.mediaPreview.d-none.d-sm-block(v-if='mediaPreview'
:src='mediaPreview' :style="{ 'object-position': position }")
v-textarea.mt-4(type='text'
@@ -35,7 +35,7 @@
v-btn(text color='primary' @click='openMediaDetails = true') {{$t('common.edit')}}
v-btn(text color='error' @click='remove') {{$t('common.remove')}}
div(v-if='mediaPreview')
img.img.col-12.ml-3(:src='mediaPreview' :style="{ 'object-position': savedPosition }")
img.mediaPreview.col-12.ml-3(:src='mediaPreview' :style="{ 'object-position': savedPosition }")
span.float-right {{event.media[0].name}}
v-file-input(
v-else
@@ -53,7 +53,7 @@ export default {
name: 'MediaInput',
props: {
value: { type: Object, default: () => ({ image: null }) },
event: { type: Object, default: () => {} }
event: { type: Object, default: () => ({}) }
},
data () {
return {
@@ -142,7 +142,7 @@ export default {
cursor: crosshair;
}
.img {
.mediaPreview {
width: 100%;
object-fit: cover;
object-position: top;

View File

@@ -1,34 +1,34 @@
<template lang="pug">
v-row
v-col(cols=12 md=6)
v-combobox(ref='place'
:rules="[$validators.required('common.where')]"
:label="$t('common.where')"
:hint="$t('event.where_description')"
:search-input.sync="placeName"
:prepend-icon='mdiMapMarker'
persistent-hint
:value="value.name"
:items="filteredPlaces"
no-filter
item-text='name'
@change='selectPlace')
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.create')
v-list-item-title <v-icon color='primary' v-text='mdiPlus' :aria-label='add'></v-icon> {{item.name}}
v-list-item-content(two-line v-else)
v-list-item-title(v-text='item.name')
v-list-item-subtitle(v-text='item.address')
v-row
v-col(cols=12 md=6)
v-combobox(ref='place'
:rules="[$validators.required('common.where')]"
:label="$t('common.where')"
:hint="$t('event.where_description')"
:search-input.sync="placeName"
:prepend-icon='mdiMapMarker'
persistent-hint
:value="value.name"
:items="filteredPlaces"
no-filter
item-text='name'
@change='selectPlace')
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.create')
v-list-item-title <v-icon color='primary' v-text='mdiPlus' :aria-label='$t("common.add")'></v-icon> {{item.name}}
v-list-item-content(two-line v-else)
v-list-item-title(v-text='item.name')
v-list-item-subtitle(v-text='item.address')
v-col(cols=12 md=6)
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-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")
</template>
<script>
@@ -61,8 +61,7 @@ export default {
if (tmpName === placeName) { nameMatch = true }
return true
}
if (tmpAddress.includes(placeName)) { return true }
return false
return tmpAddress.includes(placeName)
})
if (!nameMatch) {
matches.unshift({ create: true, name: this.placeName })