✨ Add history view
This commit is contained in:
26
src/util.js
Normal file
26
src/util.js
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user