v-container.container
v-card
v-card-title {{edit?$t('common.edit_event'):$t('common.add_event')}}
v-card-text
v-form(v-model='valid')
//- NOT LOGGED EVENT
div(v-if='!$auth.loggedIn')
v-divider {{$t('event.anon')}}
p(v-html="$t('event.anon_description')")
//- title
v-text-field.mb-3(v-model='event.title'
:rules="[validators.required('title')]"
:label="$t('event.what_description')"
autofocus
ref='title')
//- description
//- span {{$t('event.description_description')}}
Editor(
v-model='event.description'
:label="$t('event.description_description')"
style='max-height: 400px;')
//- tags
//- div {{$t('event.tag_description')}}
//- client-only
v-combobox.mt-3(v-model='event.tags'
chips small-chips multiple deletable-chips hide-no-data hide-selected
:delimiters="[',', ' ']"
:items="tags.map(t => t.tag)"
:hints="$t('event.tag_description')"
:label="$t('common.tags')")
//- WHERE
//- v-divider
//- i.el-icon-location-outline
//- span {{$t('common.where')}}
//- p(v-html="$t('event.where_description')")
v-combobox(v-model='event.place.name'
:label="$t('common.where')"
:items="places"
item-text='name'
@change='selectPlace')
template(v-slot:item="{ item }")
v-list
v-list-item-content
v-list-item-title {{item.name}}
v-list-item-subtitle {{item.address}}
//- div {{$t("common.address")}}
v-text-field(ref='address' :label="$t('common.address')" v-model='event.place.address' :disabled='disableAddress')
//- WHEN
//- v-divider {{$t('common.when')}}
.text-center
v-btn-toggle(v-model="event.type" color='primary')
v-btn(value='normal' label="normal") {{$t('event.normal')}}
v-btn(value='multidate' label="multidate") {{$t('event.multidate')}}
v-btn(v-if='settings.allow_recurrent_event' value='recurrent' label="recurrent") {{$t('event.recurrent')}}
p {{$t(`event.${event.type}_description`)}}
v-select(v-if='event.type==="recurrent"'
:items="frequencies"
v-model='event.recurrent.frequency')
//- v-option(:label="$t('event.each_week')" value='1w' key='1w')
//- v-option(:label="$t('event.each_2w')" value='2w' key='2w')
//- el-option(:label="$t('event.each_month')" value='1m' key='1m')
client-only
.datePicker
v-date-picker(
:mode='datePickerMode'
:attributes='attributes'
v-model='date'
:locale='$i18n.locale'
:from-page.sync='page'
:is-dark="settings['theme.is_dark']"
is-inline
is-expanded
:min-date='event.type !== "recurrent" && new Date()')
div.text-center.mb-2(v-if='event.type === "recurrent"')
span(v-if='event.recurrent.frequency !== "1m" && event.recurrent.frequency !== "2m"') {{whenPatterns}}
v-radio-group(v-else v-model='event.recurrent.type')
v-radio-button(v-for='whenPattern in whenPatterns' :label='whenPattern.key' :key='whenPatterns.key')
span {{whenPattern.label}}
v-row
v-col
v-menu(v-model='fromDateMenu'
:close-on-content-click="false"
transition="slide-x-transition"
ref='fromDateMenu'
:return-value.sync="time.start"
offset-y
absolute
top
max-width="290px"
min-width="290px")
template(v-slot:activator='{ on }')
v-text-field(
:label="$t('event.from')"
:value='time.start'
v-on='on'
clearable
readonly)
v-time-picker(
v-if='fromDateMenu'
:label="$t('event.from')"
format="24hr"
ref='time_start'
:allowed-minutes="[0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55]"
v-model='time.start'
@click:minute="$refs.fromDateMenu.save(time.start)")
v-col
v-menu(v-model='dueDateMenu'
:close-on-content-click="false"
transition="slide-x-transition"
ref='dueDateMenu'
:return-value.sync="time.end"
offset-y
absolute
top
max-width="290px"
min-width="290px")
template(v-slot:activator='{ on }')
v-text-field(
:label="$t('event.due')"
:value='time.end'
v-on='on'
clearable
readonly)
v-time-picker(
v-if='dueDateMenu'
:label="$t('event.due')"
format="24hr"
:allowed-minutes="[0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55]"
v-model='time.end'
@click:minute="$refs.dueDateMenu.save(time.end)")
List(v-if='event.type==="normal" && todayEvents.length' :events='todayEvents' :title='$t("event.same_day")')
//- MEDIA / FLYER / POSTER
v-file-input(
:label="$t('common.media')"
:hint="$t('event.media_description')"
prepend-icon="mdi-camera"
v-model='event.image'
persistent-hint
accept='image/*')
v-card-actions
v-spacer
v-btn(@click='done' :loading='loading' :disabled='!valid || loading'
color='primary') {{edit?$t('common.edit'):$t('common.send')}}