diff --git a/pages/add/DateInput.vue b/pages/add/DateInput.vue
index 6712ed68..52281473 100644
--- a/pages/add/DateInput.vue
+++ b/pages/add/DateInput.vue
@@ -1,80 +1,51 @@
-v-row
- v-date-picker.col-md-6(
- mode='dateTime'
- is24hr
- :input-debounce="200"
- :min-date='new Date()'
- :minute-increment="5"
- is-dark
- is-expanded
- @input='v => change("from", v)'
- :value="value.from"
- :locale='$i18n.locale')
- template(v-slot="{ inputValue, inputEvents }")
- v-text-field(
- :value='inputValue'
- :label="$t('event.from')"
- :rules="[$validators.required('common.when')]"
- ref='date'
- prepend-icon='mdi-calendar'
- persistent-hint
- readonly
- v-on="inputEvents")
+.when {{value}}
+ .text-center
+ v-btn-toggle.v-col-6.flex-column.flex-sm-row(v-model='type' color='primary' @change='type => change("type", type)')
+ 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')}}
- v-date-picker.col-md-4(
- mode='dateTime'
- is24hr
- :min-date='new Date()'
- :minute-increment="5"
- :input-debounce="200"
- is-dark
- is-expanded
- @input='v => change("due", v)'
- :value="value.due"
- :locale='$i18n.locale')
- template(v-slot="{ inputValue, inputEvents }")
- v-text-field(
- :value='inputValue'
- :label="$t('event.due')"
- ref='date'
- prepend-icon='mdi-calendar'
- persistent-hint
- readonly
- v-on="inputEvents")
+ p {{$t(`event.${type}_description`)}}
+ //- v-select.col-md-6(v-if='type==="recurrent"'
+ //- :items="frequencies" :value='value.recurrent.frequency' @change='freq => updateRecurrent({...value.recurrent, frequency: freq})')
+ v-btn-toggle.v-col-6.flex-column.flex-sm-row(v-if='type === "recurrent"' color='primary' :value='value.recurrent.frequency' @change='fq => change("frequency", fq)')
+ v-btn(v-for='f in frequencies' :key='f.value' :value='f.value') {{f.text}}
- //- v-btn-toggle(v-if="type === 'recurrent'" v-model='value.recurrent.frequency' color='primary')
- //- v-btn(v-for='f in frequencies' :value='f.value') {{f.text}}
+ client-only
+ .datePicker.mt-3
+ v-date-picker(
+ :value='fromDate'
+ @input="date => change('date', date)"
+ :is-range='type === "multidate"'
+ :attributes='attributes'
+ :locale='$i18n.locale'
+ :from-page.sync='page'
+ :is-dark="settings['theme.is_dark']"
+ is-inline
+ is-expanded
+ :min-date='type !== "recurrent" && new Date()')
- //- .datePicker
- //- v-date-picker(
- //- :mode='datePickerMode'
- //- v-model='date'
- //- :rules="[$validators.required('event.when')]"
- //- :locale='$i18n.locale'
- //- :is-dark="settings['theme.is_dark']"
- //- is-inline
- //- is-expanded
- //- :min-date='type !== "recurrent" && new Date()')
+ div.text-center.mb-2(v-if='type === "recurrent"')
+ span(v-if='value.recurrent.frequency !== "1m" && value.recurrent.frequency !== "2m"') {{whenPatterns}}
+ v-btn-toggle.mt-1.flex-column.flex-sm-row(v-else :value='value.recurrent.type' color='primary' @change='fq => change("", fq)')
+ v-btn(v-for='whenPattern in whenPatterns' :value='whenPattern.key' :key='whenPatterns.key' small) {{whenPattern.label}}
- //- v-btn-toggle.col-md-4(@change='changeType' color='primary' :value='value.type')
- //- v-btn(value='normal') {{$t('event.normal')}}
- //- v-btn(value='multidate') {{$t('event.multidate')}}
- v-switch.col-md-2(:input-value='isRecurrent' :label="$t('event.recurrent')" inset @change='updateRecurrent')
- //- v-menu(v-if='settings.allow_recurrent_event && isRecurrent' offset-y open-on-hover)
- //- template(v-slot:activator="{ on, attrs }")
- //- v-btn.col-md-2.mt-2(color='primary' value='recurrent' v-on='on') {{$t('event.recurrent')}}
- //- v-btn-group(v-if='settings.allow_recurrent_event && isRecurrent')
- v-btn-toggle.col-md-12(dense group text link v-if='isRecurrent' color='primary' v-model='value.recurrent.frequency')
- v-btn(text link v-for='f in frequencies' :key='f.value' :value='f.value'
- @click='selectFrequency(f.value)') {{f.text}}
+ v-row.mt-3.col-md-6.mx-auto
+ v-col.col-12.col-sm-6
+ v-select(dense :label="$t('event.from')" :value='fromHour'
+ :items='hourList' @change='hr => change("fromHour", hr)')
- div.col-md-12(v-if='isRecurrent')
- p(v-if='value.recurrent.frequency !== "1m" && value.recurrent.frequency !== "2m"') 🡲 {{whenPatterns}}
- v-btn-toggle(v-else dense group v-model='value.recurrent.type' color='primary')
- v-btn(text link v-for='whenPattern in whenPatterns' :value='whenPattern.key' :key='whenPatterns.key') {{whenPattern.label}}
+ v-col.col-12.col-sm-6
+ v-select(dense :label="$t('event.due')" :value='dueHour'
+ :items='hourList' @change='hr => change("dueHour", hr)')
- //- List(v-if='type==="normal" && todayEvents.length' :events='todayEvents' :title='$t("event.same_day")')
+ //- div.col-md-12(v-if='isRecurrent')
+ //- p(v-if='value.recurrent.frequency !== "1m" && value.recurrent.frequency !== "2m"') 🡲 {{whenPatterns}}
+ //- v-btn-toggle(v-else dense group v-model='value.recurrent.type' color='primary')
+ //- v-btn(text link v-for='whenPattern in whenPatterns' :value='whenPattern.key' :key='whenPatterns.key') {{whenPattern.label}}
+
+ //- List(v-if='event.type==="normal" && todayEvents.length' :events='todayEvents' :title='$t("event.same_day")')
+
+
diff --git a/pages/add/WhereInput.vue b/pages/add/WhereInput.vue
index b87bb187..353d0a35 100644
--- a/pages/add/WhereInput.vue
+++ b/pages/add/WhereInput.vue
@@ -21,7 +21,7 @@
v-text-field.col-md-6(ref='address'
prepend-icon='mdi-map'
- :disabled='disableAddress'
+ v-show='!disableAddress'
:rules="[$validators.required('common.address')]"
:label="$t('common.address')"
@change="changeAddress"
diff --git a/pages/add/_edit.vue b/pages/add/_edit.vue
index c9721eae..a20f4484 100644
--- a/pages/add/_edit.vue
+++ b/pages/add/_edit.vue
@@ -1,5 +1,5 @@
- v-container.container
+ v-container.container.px-0.px-md-3
v-card
v-card-title
h4 {{edit?$t('common.edit_event'):$t('common.add_event')}}
@@ -9,13 +9,12 @@
v-dialog(v-model='openImportDialog')
ImportDialog(@close='openImportDialog=false' @imported='eventImported')
- v-card-text
+ v-card-text.px-0.px-xs-2
v-form(v-model='valid' ref='form' lazy-validation)
v-container
v-row
//- Not logged event
v-col.col-12(v-if='!$auth.loggedIn')
- v-divider {{$t('event.anon')}}
p(v-html="$t('event.anon_description')")
//- Title
@@ -42,7 +41,7 @@
max-height='400px')
//- MEDIA / FLYER / POSTER
- v-file-input.col-6.mt-3(
+ v-file-input.col-12.col-sm-6.mt-3(
:label="$t('common.media')"
:hint="$t('event.media_description')"
prepend-icon="mdi-camera"
@@ -51,7 +50,7 @@
accept='image/*')
//- tags
- v-combobox.col-6.mt-3(v-model='event.tags'
+ v-combobox.col-12.col-sm-6.mt-3(v-model='event.tags'
prepend-icon="mdi-tag-multiple"
chips small-chips multiple deletable-chips hide-no-data hide-selected persistent-hint
:delimiters="[',', ' ']"
@@ -98,7 +97,8 @@ export default {
data.date = {
recurrent: event.recurrent,
from: new Date(dayjs.unix(event.start_datetime)),
- due: new Date(dayjs.unix(event.end_datetime))
+ due: new Date(dayjs.unix(event.end_datetime)),
+ multidate: event.multidate
}
data.event.title = event.title
@@ -163,7 +163,7 @@ export default {
formData.append('place_name', this.event.place.name)
formData.append('place_address', this.event.place.address)
formData.append('description', this.event.description)
- // formData.append('multidate', this.date.type === 'multidate')
+ formData.append('multidate', !!this.date.multidate)
formData.append('start_datetime', dayjs(this.date.from).unix())
formData.append('end_datetime', this.date.due && dayjs(this.date.due).unix())