mirror of
https://github.com/QwIT-Development/firka-extension.git
synced 2026-06-12 03:41:39 +02:00
fix custom homework
This commit is contained in:
@@ -160,7 +160,7 @@
|
||||
}
|
||||
|
||||
function getLessonKey(lesson) {
|
||||
return `${lesson.subject}_${lesson.startTime}_${lesson.day}`;
|
||||
return `${lesson.subject}_${lesson.startTime}_${lesson.date}`;
|
||||
}
|
||||
|
||||
async function updateHomeworkIconsFromCookie() {
|
||||
@@ -410,6 +410,7 @@
|
||||
originalTeacher: "",
|
||||
room: "",
|
||||
day: dayIndex,
|
||||
date: weekDates[dayIndex]?.fullDate || eventDate.toISOString().split('T')[0],
|
||||
isSubstituted: false,
|
||||
isCancelled: false,
|
||||
hasHomework: false,
|
||||
@@ -457,6 +458,7 @@
|
||||
originalTeacher: event.helyettesitoId ? teacher : "",
|
||||
room: room,
|
||||
day: dayIndex,
|
||||
date: weekDates[dayIndex]?.fullDate || eventDate.toISOString().split('T')[0],
|
||||
isSubstituted: !!event.helyettesitoId,
|
||||
isCancelled: isCancelled,
|
||||
hasHomework: event.hasHaziFeladat || false,
|
||||
@@ -619,9 +621,13 @@
|
||||
</div>
|
||||
${
|
||||
(() => {
|
||||
const lessonKey = `${lesson.subject}_${lesson.startTime}_${lesson.day}`;
|
||||
const hasCustomHomework = customHomework[lessonKey] && customHomework[lessonKey].length > 0;
|
||||
const hasCustomTests = customTests[lessonKey] && customTests[lessonKey].length > 0;
|
||||
const lessonKey = `${lesson.subject}_${lesson.startTime}_${lesson.date}`;
|
||||
const customHomeworkItems = customHomework[lessonKey] || [];
|
||||
const customTestItems = customTests[lessonKey] || [];
|
||||
const hasCustomHomework = customHomeworkItems.length > 0;
|
||||
const hasCustomTests = customTestItems.length > 0;
|
||||
const allCustomHomeworkCompleted = hasCustomHomework && customHomeworkItems.every(hw => hw.completed);
|
||||
const allCustomTestsCompleted = hasCustomTests && customTestItems.every(test => test.completed);
|
||||
const hasAnyIndicators = lesson.hasHomework || lesson.testInfo || hasCustomHomework || hasCustomTests;
|
||||
|
||||
return hasAnyIndicators ? `
|
||||
@@ -648,7 +654,7 @@
|
||||
hasCustomHomework
|
||||
? `
|
||||
<span class="lesson-indicator custom-homework-indicator" title="Saját házi feladat">
|
||||
<img src="${chrome.runtime.getURL("icons/homework.svg")}" alt="Saját házi feladat" style="width: 20px; height: 20px; opacity: 0.7;">
|
||||
<img src="${chrome.runtime.getURL(allCustomHomeworkCompleted ? "icons/pipa.svg" : "icons/homework.svg")}" alt="${allCustomHomeworkCompleted ? 'Megoldott saját házi feladat' : 'Saját házi feladat'}" style="width: 20px; height: 20px; opacity: 0.7;">
|
||||
</span>
|
||||
`
|
||||
: ""
|
||||
@@ -657,7 +663,7 @@
|
||||
hasCustomTests
|
||||
? `
|
||||
<span class="lesson-indicator custom-test-indicator" title="Saját számonkérés">
|
||||
<img src="${chrome.runtime.getURL("icons/assigment.svg")}" alt="Saját számonkérés" style="width: 20px; height: 20px; opacity: 0.7;">
|
||||
<img src="${chrome.runtime.getURL(allCustomTestsCompleted ? "icons/pipa.svg" : "icons/assigment.svg")}" alt="${allCustomTestsCompleted ? 'Megoldott saját számonkérés' : 'Saját számonkérés'}" style="width: 20px; height: 20px; opacity: 0.7;">
|
||||
</span>
|
||||
`
|
||||
: ""
|
||||
|
||||
Reference in New Issue
Block a user