This repository has been archived by the owner on Dec 8, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtimetable.html
69 lines (51 loc) · 1.59 KB
/
timetable.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
---
<!DOCTYPE html>
<html lang="en">
<head>
{% include head.html %}
</head>
<body>
{% include nav.html %}
<div class="container">
<div style="height:25vh"></div>
<div class="center">
<h1>Timetable</h1>
<p>Here is your current / upcoming timetable(s):</p>
</div>
<div id="semesters">
<div class="d-flex justify-content-center">
<div class="spinner-border" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
</div>
</div>
{% include foot.html %}
<!-- Auth redirect handler -->
<script src="/assets/js/cookies.js"></script>
<script src="/assets/js/api.js"></script>
<script src="/assets/js/navbar.js"></script>
<script>
if (!cookieExists("auth_token_2")) {
console.log("Redirecting to login page");
document.location = "/login";
}
</script>
<!-- Build tables for courses -->
<script src="/assets/js/timetable.js"></script>
<script>
// Get timetable data
getTimetable((timetable) => {
// Build all tables
var html = ""
for (let i = 0; i < timetable.timetable.course_semesters.length; i++) {
// Add to the semesters list
html += generateEntireSemester(i + 1, timetable.timetable.course_semesters[i]);
}
// Set the content div to contain the HTML
document.getElementById("semesters").innerHTML = html;
})
</script>
</body>
</html>