diff --git a/student/uebersicht.html b/student/uebersicht.html index b0cd736..7a4dfa3 100644 --- a/student/uebersicht.html +++ b/student/uebersicht.html @@ -74,13 +74,13 @@ Prof. Dr. Kurt Schneider
Termine -
+
Di 01.01.2023, 13:00 - 15:00 Uhr
Raum 023, Gebäude 2323
Bewertungen -
+
Di, 01.01.2023
Di, 01.01.2023
Di, 01.01.2023
@@ -95,8 +95,44 @@ const couchDB = new CouchDB(); setUserData(couchDB).then((val) => { + setCourseView(); }); + async function setCourseView() { + const courseList = document.getElementById("courses-list"); + courseList.innerHTML = ""; + + for (const courseId of userData.courses) { + const course = await couchDB.get("course:" + courseId); + + const card = document.createElement("div"); + card.className = "course-card"; + + card.innerHTML = ` +
${course.title}
+ +
+ ${course.description} +
+ + + `; + courseList.appendChild(card); + } + } + + async function deleteCourse(courseId) { + await couchDB.delete("course:" + courseId); + + const users = await couchDB.get("users"); + users[userData.name].courses = users[userData.name].courses.filter(id => id !== courseId); + await couchDB.set("users", users); + + location.reload(); + } + function participateInSurvey() { showOverlay("survey"); }