Revert "#23 fix"

This reverts commit 1429943dbe.
This commit is contained in:
Zan
2026-01-15 16:27:36 +01:00
parent 1f34cacf25
commit 5248cfc12e

View File

@@ -506,26 +506,6 @@
return timeA - timeB;
},
);
const timeDurations = {};
times.forEach(time => {
const lessonsAtTime = regularLessons.filter(l => l.startTime === time);
let maxDuration = 45;
lessonsAtTime.forEach(lesson => {
if (lesson.endTime) {
const startMinutes = helper.convertTimeToMinutes(lesson.startTime);
const endMinutes = helper.convertTimeToMinutes(lesson.endTime);
const duration = endMinutes - startMinutes;
if (duration > maxDuration) {
maxDuration = duration;
}
}
});
timeDurations[time] = maxDuration;
});
const days = [
LanguageManager.t("timetable.monday"),
LanguageManager.t("timetable.tuesday"),
@@ -583,11 +563,8 @@
return lastTime;
});
const duration = timeDurations[time] || 45;
const slotHeight = Math.max(84, (duration / 45) * 100);
return `
<div class="time-slot" style="min-height: ${slotHeight}px;">${time}</div>
<div class="time-slot">${time}</div>
${Array(5)
.fill()
.map((_, dayIndex) => {
@@ -599,11 +576,11 @@
const isAfterLastLesson = lastLessonTime && helper.convertTimeToMinutes(time) > helper.convertTimeToMinutes(lastLessonTime);
if (dayLessons.length === 0 && isAfterLastLesson) {
return `<div class="lesson-slot" style="min-height: ${slotHeight}px;"></div>`;
return `<div class="lesson-slot"></div>`;
}
return `
<div class="lesson-slot ${dayLessons.length === 0 ? 'empty-slot' : ''}" style="min-height: ${slotHeight}px;">
<div class="lesson-slot ${dayLessons.length === 0 ? 'empty-slot' : ''}">
${dayLessons.length === 0 ? '<div class="empty-lesson-placeholder"></div>' : ''}
${dayLessons
.map(