Commit d17df0d4 authored by Richard Blechinger's avatar Richard Blechinger
Browse files

Implement creation of repetition schedules (minus custom option)

parent 9bd21f43
......@@ -8077,9 +8077,9 @@
}
},
"jquery": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz",
"integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg=="
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz",
"integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw=="
},
"js-levenshtein": {
"version": "1.1.6",
......
......@@ -13,7 +13,7 @@
"bootstrap-vue": "^2.16.0",
"dompurify": "^2.0.12",
"filesize": "^4.2.1",
"jquery": "^3.5.1",
"jquery": "3.4.1",
"moment": "^2.27.0",
"node-polyglot": "^2.4.0",
"oidc-client": "^1.10.1",
......@@ -52,9 +52,13 @@
"curly": "error",
"block-spacing": "error",
"keyword-spacing": "error",
"vue/html-indent": ["warning", 4, {
"baseIndent": 1
}]
"vue/html-indent": [
"warning",
4,
{
"baseIndent": 1
}
]
},
"parserOptions": {
"parser": "babel-eslint"
......
<template>
<div id="app" class="tw-flex tw-flex-col tw-min-h-screen" :key="localeKey">
<div
id="app"
:key="localeKey"
class="tw-flex tw-flex-col tw-min-h-screen"
>
<app-header
:modules="modules"
:user="user"
/>
<div class="tw-flex-1 tw-flex tw-my-8">
<router-view :modules="modules" :user="user"/>
<router-view
:modules="modules"
:user="user"
/>
</div>
<app-footer :modules="modules"/>
<app-footer :modules="modules" />
</div>
</template>
......
<template>
<auth-wall>
<b-container>
<b-container>
<auth-wall>
<show-selector
ref="showSelector"
:title="$t('navigation.calendar')"
......@@ -82,18 +82,18 @@
@event-resize="eventResize"
@event-created="eventCreated"
/>
<app-modalEmissionManagerCreate
ref="appModalEmissionManagerCreate"
/>
<app-modalEmissionManagerResolve
ref="appModalEmissionManagerResolve"
/>
<app-modalEmissionManagerEdit
ref="appModalEmissionManagerEdit"
/>
</b-container>
</auth-wall>
</auth-wall>
<app-modalEmissionManagerCreate
ref="appModalEmissionManagerCreate"
/>
<app-modalEmissionManagerResolve
ref="appModalEmissionManagerResolve"
/>
<app-modalEmissionManagerEdit
ref="appModalEmissionManagerEdit"
/>
</b-container>
</template>
<script>
......
......@@ -25,7 +25,7 @@
</b-container>
</footer>
</template>
npm
<script>
export default {
props: {
......
......@@ -49,9 +49,9 @@
</div>
<div v-else>
<p>
This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{
This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{
prettyDate(schedule.until) }}
</p>
</p>
<p>All timeslots of this schedule:</p>
<b-table
......@@ -105,7 +105,10 @@ This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{
/>
</label>
<b-checkbox v-model="useSameTime">
<b-checkbox
v-if="repetitionRule !== 4"
v-model="useSameTime"
>
Use same start and end time
</b-checkbox>
</b-col>
......@@ -140,6 +143,13 @@ This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{
</b-col>
</b-row>
<b-row
v-if="repetitionRule === 4"
class="tw-mt-4"
>
Wir arbeiten dran. :)
</b-row>
<b-row class="mt-4">
<b-col>
<b-button
......@@ -242,12 +252,6 @@ This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{
onlyBusinessDays: false,
addNoOfDays: 1,
repetitionRule: 1,
repetitionOptions: [
{value: 1, text: "On the following day"},
{value: 2, text: "On the following business day"},
{value: 3, text: "Number of days later"},
{value: 4, text: "Custom (WIP)"},
]
}
},
......@@ -260,6 +264,15 @@ This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{
}
},
repetitionOptions() {
return [
{value: 1, text: this.$t("On the following day")},
{value: 2, text: this.$t("On the following business day")},
{value: 3, text: this.$t("Number of days later")},
// {value: 4, text: this.$t("Custom")},
];
},
...mapGetters({
selectedShow: 'shows/selectedShow',
schedule: 'shows/schedule',
......@@ -294,7 +307,7 @@ This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{
byweekday,
is_repetition: true,
add_business_days_only: onlyBusinessDays,
add_days_no: addNoOfDays,
add_days_no: parseInt(addNoOfDays, 10),
}
};
......@@ -416,7 +429,18 @@ This is a recurring event: <b>{{ rruleRender(schedule.rrule) }}</b>, until: {{
// initialise a new schedule and open the modal
open(timeslot) {
const timeslotIndex = this.scheduleTimeslots.findIndex(item => item.id === timeslot.id);
let timeslotPage = Math.ceil(timeslotIndex / this.perPage);
const timeslotIsFirstEntryOnPage = timeslotIndex === ((timeslotPage) * this.perPage);
// The math above is slightly off for every first entry on the page
// So we add 1 to adjust the page to the correct one
if (timeslotIsFirstEntryOnPage) {
timeslotPage += 1;
}
this.timeslot = timeslot
this.currentPage = timeslotPage;
this.$refs.modalEmissionManagerEdit.show()
this.loadSchedule(timeslot.schedule)
},
......
export default {
computed: {
rruleOptions () {
return [
{ value: 1, text: 'einmalig' },
{ value: 2, text: 'täglich' },
{ value: 3, text: 'werktäglich' },
{ value: 4, text: 'wöchentlich' },
{ value: 5, text: 'zweiwöchentlich' },
{ value: 6, text: 'vierwöchentlich' },
{ value: 7, text: 'gerade Kalenderwoche' },
{ value: 8, text: 'ungerade Kalenderwoche' },
{ value: 9, text: 'Jede 1. Woche im Monat' },
{ value: 10, text: 'Jede 2. Woche im Monat' },
{ value: 11, text: 'Jede 3. Woche im Monat' },
{ value: 12, text: 'Jede 4. Woche im Monat' },
{ value: 13, text: 'Jede 5. Woche im Monat' },
]
}
},
methods: {
rruleRender(rrule) {
return this.$t(`rrule.rule.${rrule}`)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment