diff --git a/components/DateInput.vue b/components/DateInput.vue index b782f2b8..4e1ef72b 100644 --- a/components/DateInput.vue +++ b/components/DateInput.vue @@ -83,6 +83,7 @@ v-col(cols=12) :disabled='!value.fromHour' readonly :prepend-icon="mdiClockTimeEightOutline" + :rules="[settings.allow_event_without_end_time ? true : $validators.required('event.due')]" v-bind="attrs" v-on="on") v-time-picker( diff --git a/components/admin/Settings.vue b/components/admin/Settings.vue index 6aa49ea1..9e04ee7d 100644 --- a/components/admin/Settings.vue +++ b/components/admin/Settings.vue @@ -52,6 +52,10 @@ v-container inset :label="$t('admin.recurrent_event_visible')") + v-switch.mt-1(v-model='allow_event_without_end_time' + inset + :label="$t('admin.allow_event_without_end_time')") + v-switch.mt-1(v-model='allow_online_event' inset :label="$t('admin.allow_online_event')") @@ -139,6 +143,10 @@ export default { get () { return this.settings.allow_recurrent_event }, set (value) { this.setSetting({ key: 'allow_recurrent_event', value }) } }, + allow_event_without_end_time: { + get () { return this.settings.allow_event_without_end_time }, + set (value) { this.setSetting({ key: 'allow_event_without_end_time', value }) } + }, allow_multidate_event: { get () { return this.settings.allow_multidate_event }, set (value) { this.setSetting({ key: 'allow_multidate_event', value }) } diff --git a/locales/de.json b/locales/de.json index 83427975..5248569c 100644 --- a/locales/de.json +++ b/locales/de.json @@ -182,6 +182,7 @@ "title_description": "Dieses wird im Seitentitel, in der Betreffzeile von E-Mails, beim Export von RSS-Feeds und ICS angezeigt.", "description_description": "Erscheint in der Kopfzeile neben dem Titel", "allow_recurrent_event": "Wiederkehrende Veranstaltungen erlauben", + "allow_event_without_end_time": "Erlaube Veranstaltungen ohne Endzeit", "recurrent_event_visible": "Wiederkehrende Veranstaltungen sind standardmäßig sichtbar", "enable_federation": "Federation aktivieren", "allow_anon_event": "Kann man auch anonyme Veranstaltungen (vorausgesetzt, diese werden genehmigt) eintragen?", diff --git a/locales/en.json b/locales/en.json index 4a48120b..77eb05e2 100644 --- a/locales/en.json +++ b/locales/en.json @@ -235,6 +235,7 @@ "enable_report_hint": "Any visitor could report an event, admins are notified via e-mail", "allow_multidate_event": "Allow multi-day events", "allow_recurrent_event": "Allow recurring events", + "allow_event_without_end_time": "Allow events without end time", "allow_online_event": "Allow online events", "allow_geolocation": "Allow events geolocation", "allow_geolocation_hint": "Optionally set the exact location of an event on a geographic map", diff --git a/server/api/controller/settings.js b/server/api/controller/settings.js index 0e5e1caa..e784e2f0 100644 --- a/server/api/controller/settings.js +++ b/server/api/controller/settings.js @@ -26,6 +26,7 @@ const defaultSettings = { allow_anon_event: true, allow_multidate_event: true, allow_recurrent_event: false, + allow_event_without_end_time: true, allow_online_event: true, show_download_media: true, enable_moderation: false, diff --git a/server/helpers.js b/server/helpers.js index 9cc6e554..0019f510 100644 --- a/server/helpers.js +++ b/server/helpers.js @@ -77,6 +77,7 @@ module.exports = { allow_registration: settings.allow_registration, allow_anon_event: settings.allow_anon_event, allow_recurrent_event: settings.allow_recurrent_event, + allow_event_without_end_time: settings.allow_event_without_end_time, enable_moderation: settings.enable_moderation, enable_report: settings.enable_report, allow_multidate_event: settings.allow_multidate_event, diff --git a/store/index.js b/store/index.js index 2829df61..d8afdc35 100644 --- a/store/index.js +++ b/store/index.js @@ -12,6 +12,7 @@ export const state = () => ({ enable_report: false, allow_multidate_event: true, allow_recurrent_event: true, + allow_event_without_end_time: true, allow_online_event: true, show_download_media: true, allow_geolocation: false,