diff --git a/src/views/TimetableView.vue b/src/views/TimetableView.vue index 61283ba..4b7edca 100644 --- a/src/views/TimetableView.vue +++ b/src/views/TimetableView.vue @@ -24,12 +24,20 @@ const timetable = computed(() => { return newDay; }); -function isChanged(substitution, key) { +function isChanged(lesson, key) { + const substitution = lesson.substitution; if (!substitution) return false; if (!substitution.change) return false; const changedKeys = Object.keys(substitution.change); - if (changedKeys.includes(key)) return true; - else return false; + if (!changedKeys.includes(key)) return false; + console.log(lesson, changedKeys); + return lesson[key] != substitution.change[key]; +} + +function getNotes(substitution) { + if (!substitution) return; + if (!substitution.notes) return; + return substitution.notes; } function isCancelled(substitution) { @@ -44,10 +52,7 @@ function isCancelled(substitution) { {{ index + 1 }}
- + {{ lesson.subject }} {{ lesson.substitution.change.subject }} @@ -59,13 +64,13 @@ function isCancelled(substitution) {
- + {{ lesson.teacher }} {{ lesson.substitution.change.teacher }}, {{ lesson.teacher }}, - + {{ lesson.room }} {{ lesson.substitution.change.room }} {{ lesson.room }}