diff --git a/components/DateInput.vue b/components/DateInput.vue index c9330406..9166e2c7 100644 --- a/components/DateInput.vue +++ b/components/DateInput.vue @@ -3,12 +3,11 @@ v-col(cols=12) .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_multidate_event' 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.${type}_description`) }} - 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 }} diff --git a/components/admin/Settings.vue b/components/admin/Settings.vue index 938609b4..cfc12c52 100644 --- a/components/admin/Settings.vue +++ b/components/admin/Settings.vue @@ -39,6 +39,10 @@ v-container inset :label="$t('admin.allow_anon_event')") + v-switch.mt-1(v-model='allow_multidate_event' + inset + :label="$t('admin.allow_multidate_event')") + v-switch.mt-1(v-model='allow_recurrent_event' inset :label="$t('admin.allow_recurrent_event')") @@ -107,6 +111,10 @@ export default { get () { return this.settings.allow_recurrent_event }, set (value) { this.setSetting({ key: 'allow_recurrent_event', value }) } }, + allow_multidate_event: { + get () { return this.settings.allow_multidate_event }, + set (value) { this.setSetting({ key: 'allow_multidate_event', value }) } + }, recurrent_event_visible: { get () { return this.settings.recurrent_event_visible }, set (value) { this.setSetting({ key: 'recurrent_event_visible', value }) } diff --git a/locales/en.json b/locales/en.json index 4b68e27c..d89eae51 100644 --- a/locales/en.json +++ b/locales/en.json @@ -192,6 +192,7 @@ "event_remove_ok": "Event removed", "allow_registration_description": "Allow open registrations?", "allow_anon_event": "Allow anonymous events (has to be confirmed)?", + "allow_multidate_event": "Allow multi-day events", "allow_recurrent_event": "Allow recurring events", "allow_geolocation": "Allow events geolocation", "recurrent_event_visible": "Show recurring events by default", diff --git a/server/api/controller/settings.js b/server/api/controller/settings.js index b2f96bcc..03d775f7 100644 --- a/server/api/controller/settings.js +++ b/server/api/controller/settings.js @@ -27,6 +27,7 @@ const defaultSettings = { instance_place: '', allow_registration: true, allow_anon_event: true, + allow_multidate_event: true, allow_recurrent_event: false, recurrent_event_visible: false, allow_geolocation: true, diff --git a/server/helpers.js b/server/helpers.js index c187e347..d58edb70 100644 --- a/server/helpers.js +++ b/server/helpers.js @@ -80,6 +80,7 @@ module.exports = { allow_registration: settings.allow_registration, allow_anon_event: settings.allow_anon_event, allow_recurrent_event: settings.allow_recurrent_event, + allow_multidate_event: settings.allow_multidate_event, recurrent_event_visible: settings.recurrent_event_visible, enable_federation: settings.enable_federation, enable_resources: settings.enable_resources, diff --git a/store/index.js b/store/index.js index c4f58fa1..7e456ae0 100644 --- a/store/index.js +++ b/store/index.js @@ -6,6 +6,7 @@ export const state = () => ({ instance_name: '', allow_registration: true, allow_anon_event: true, + allow_multidate_event: true, allow_recurrent_event: true, recurrent_event_visible: false, allow_geolocation: false,