Add history view

This commit is contained in:
2022-04-30 18:21:45 +02:00
parent 63d335d04a
commit 6e118221b9
5 changed files with 166 additions and 29 deletions

26
src/util.js Normal file
View File

@ -0,0 +1,26 @@
import { substitutionTexts } from "./definitions";
export function getSubstitutionText(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;
}