✨ Add history view
This commit is contained in:
@ -1,32 +1,8 @@
|
||||
<script setup>
|
||||
import { substitutionsForDate } from "../store";
|
||||
import dayjs from "dayjs";
|
||||
import { dayNames, substitutionTexts, uiTexts } from "../definitions";
|
||||
|
||||
function getText(substitution) {
|
||||
var text = "";
|
||||
if (substitution.type == "change") {
|
||||
const change = substitution.change;
|
||||
if (change.subject) {
|
||||
text += substitutionTexts.subjectChange + " " + change.subject;
|
||||
}
|
||||
if (change.teacher && text == "") {
|
||||
text += substitutionTexts.teacherChange + " " + change.teacher;
|
||||
} else if (change.teacher) {
|
||||
text += " " + substitutionTexts.teacherChangePartial;
|
||||
text += " " + change.teacher;
|
||||
}
|
||||
if (change.room && text == "") {
|
||||
text += substitutionTexts.roomChange + " " + change.room;
|
||||
} else if (change.room) {
|
||||
text += " " + substitutionTexts.roomChangePartial;
|
||||
text += " " + change.room;
|
||||
}
|
||||
} else if (substitution.type == "cancellation") {
|
||||
text += substitutionTexts.cancellation;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
import { dayNames, uiTexts } from "../definitions";
|
||||
import { getSubstitutionText } from "../util";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -43,7 +19,7 @@ function getText(substitution) {
|
||||
<div class="substitution">
|
||||
<span class="hour">{{ substitution.lesson }}</span>
|
||||
<div class="infos">
|
||||
<span class="text">{{ getText(substitution) }}</span>
|
||||
<span class="text">{{ getSubstitutionText(substitution) }}</span>
|
||||
<span class="notes">
|
||||
{{ substitution.notes ? uiTexts.substitutionNotes + ": " : "" }}
|
||||
{{ substitution.notes }}
|
||||
|
Reference in New Issue
Block a user