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

More translation adjustments, gray out past emissions, prevent deletion of old timeslots

parent c297d5c3
......@@ -152,24 +152,26 @@
class="tw-w-full tw-flex tw-justify-between tw-items-center"
>
<div class="tw-space-x-2">
<b-button
variant="danger"
size="sm"
@click="deleteFullSchedule(schedule.id)"
>
<span v-if="scheduleTimeslots.length === 1">{{ $t('scheduleEditor.delete.delete') }}</span>
<span v-else-if="schedule.rrule === 1">{{ $t('scheduleEditor.delete.both') }}</span>
<span v-else>{{ $t('scheduleEditor.delete.scheduleTimeslots') }}</span>
</b-button>
<b-button
v-if="schedule.rrule > 1 && scheduleTimeslots.length > 1"
variant="danger"
size="sm"
@click="deleteSingleTimeslot(schedule.id, timeslot.id)"
>
{{ $t('scheduleEditor.delete.timeslot') }}
</b-button>
<template v-if="isInTheFuture(timeslot)">
<b-button
variant="danger"
size="sm"
@click="deleteFullSchedule(schedule.id)"
>
<span v-if="scheduleTimeslots.length === 1">{{ $t('scheduleEditor.delete.delete') }}</span>
<span v-else-if="schedule.rrule === 1">{{ $t('scheduleEditor.delete.both') }}</span>
<span v-else>{{ $t('scheduleEditor.delete.scheduleTimeslots') }}</span>
</b-button>
<b-button
v-if="schedule.rrule > 1 && scheduleTimeslots.length > 1"
variant="danger"
size="sm"
@click="deleteSingleTimeslot(schedule.id, timeslot.id)"
>
{{ $t('scheduleEditor.delete.timeslot') }}
</b-button>
</template>
<b-button
v-if="schedule.rrule > 1 && scheduleTimeslots.length > 1"
......@@ -269,11 +271,19 @@
return '';
}
return item.id === this.timeslot.id
? 'table-info'
: ''
},
isInTheFuture(timeslot) {
const start = new Date(timeslot.start);
const now = new Date();
return start > now;
},
createRepetitionSchedule() {
const {onlyBusinessDays, addNoOfDays} = this.getRepetitionParameters();
const {dstart, tstart, tend, rrule, until, fallback_id, automation_id, byweekday} = this.schedule;
......
......@@ -73,13 +73,13 @@
variant="outline-danger"
@click="resetFilter()"
>
{{ $t('showTimeslots.applyFilters') }}
{{ $t('showTimeslots.resetFilters') }}
</b-btn> &nbsp;
<b-btn
variant="outline-success"
@click="applyFilter()"
>
{{ $t('showTimeslots.resetFilters') }}
{{ $t('showTimeslots.applyFilters') }}
</b-btn>
</b-container>
</b-collapse>
......@@ -96,6 +96,7 @@
outlined
:fields="notesTableArrayFields"
:items="notesTableArray"
:tbody-tr-class="notesTableRowClass"
>
<template v-slot:cell(thumbnail)="data">
<div
......@@ -124,14 +125,14 @@
<!-- And here all the buttons for editing and doing other things
with the displayed timeslot -->
<template v-slot:cell(options)="data">
<span
class="timeslotEditLink"
@click="editTimeslotNote(data.item.options.id, data.item.options.schedule)"
><img
src="/assets/16x16/emblem-system.png"
:alt="$t('showTimeslots.editDescription')"
:title="$t('showTimeslots.editDescription')"
></span>
<span
class="timeslotEditLink"
@click="editTimeslotNote(data.item.options.id, data.item.options.schedule)"
><img
src="/assets/16x16/emblem-system.png"
:alt="$t('showTimeslots.editDescription')"
:title="$t('showTimeslots.editDescription')"
></span>
<span
class="timeslotEditLink"
@click="editTimeslotPlaylist(selectedShow, data.item.options.schedule, data.item.options.id)"
......@@ -259,10 +260,14 @@
}
}
const { duration, minutes } = this.prettyDuration(timeslot.start, timeslot.end);
rows.push({
title: note ? note.title : null,
startTimestamp: timeslot.start,
starts: this.prettyDateTime(timeslot.start),
duration: this.prettyDuration(timeslot.start, timeslot.end),
duration,
durationInMinutes: minutes,
thumbnail: note ? process.env.VUE_APP_BASEURI_MEDIA + note.thumbnails[2] : null,
options: {
id: timeslot.id,
......@@ -300,6 +305,19 @@
},
methods: {
notesTableRowClass(item) {
const minutesInMs = item.durationInMinutes * 60 * 1000;
const now = new Date()
const startDate = new Date(item.startTimestamp);
const endDate = new Date(startDate.getTime() + minutesInMs)
console.log(now, endDate, now > endDate);
if (now > endDate) {
return 'tw-opacity-50'
}
},
// Apply the newly set filter parameters for our timeslot table
applyFilter() {
this.timeslotmeta.page = 1
......
......@@ -193,7 +193,7 @@ export default {
},
'showTimeslots': {
'toggleFilters': 'Sendeplatz-Filter ein-/ausblenden',
'toggleFilters': 'Ausstrahlungs-Filter ein-/ausblenden',
'applyFilters': 'Filter anwenden',
'resetFilters': 'Filter zurücksetzen',
......@@ -204,7 +204,7 @@ export default {
'uploadToCba': 'Aufnahme zum CBA hochladen',
'switchToEmissions': 'Zur Austrahlungsverwaltung wechseln',
'numberOfSlots': 'Anzahl an Sendeplätzen',
'numberOfSlots': 'Anzahl an Ausstrahlungen',
'from': 'Von',
'to': 'Bis (exklusive)',
},
......@@ -390,7 +390,7 @@ export default {
'both': 'Beide löschen',
'scheduleTimeslots': 'Programm und alle Sendeplätze löschen',
'timeslot': 'Sendeplatz löschen',
'allTimeslots': 'Alle Sendeplätze löschen',
'allTimeslots': 'Alle zukünftigen Sendeplätze löschen',
},
'repetition': {
......
......@@ -390,7 +390,7 @@ export default {
'both': 'Delete both',
'scheduleTimeslots': 'Delete schedule and all timeslots',
'timeslot': 'Delete timeslot',
'allTimeslots': 'Delete all timeslots',
'allTimeslots': 'Delete all future timeslots',
},
'repetition': {
......
......@@ -85,7 +85,7 @@ export default {
duration += seconds - 60 * minutes
duration += 'sec'
}
return duration
return { duration, minutes }
},
durationInSeconds: function (ns) {
const durationInMilliseconds = Math.floor(ns / 1000 / 1000);
......
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