-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
187 lines (178 loc) · 10.8 KB
/
index.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/styles/style.css">
<link rel="stylesheet" href="/styles/index/index.css">
<link rel="stylesheet" href="/styles/index/table/popup.css">
<link rel="stylesheet" href="/styles/index/table/table.css">
<link rel="stylesheet" href="/styles/index/table/statusDisplay.css">
<link rel="stylesheet" href="/styles/general/errorDisplay.css">
<title>BetterUntis</title>
<script src="src/viewToggle.js"></script>
<link rel="manifest" href="manifest.json">
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/service-worker.js')
.then(registration => {
console.log("Registered!");
}).catch(console.error);
}
</script>
</head>
<body onload="setLastRefreshed(getCurrentTime())">
<div class="head">
<div class="topnav">
<div class="controls-left">
<!-- View toggle -->
<div class="toggle-switch">
<input type="checkbox" id="view-toggle" style="display:none" />
<label for="view-toggle" class="switch-label">
<img src="/public/user_single.png" width="25" height="25" class="userIcon" id="singleUserIcon">
<img src="/public/user_multiple.png" width="25" height="25" class="userIcon" id="multiUserIcon">
</label>
</div>
<!-- Profile-switch -->
<select name="profiles" id="profiles" class="profile-select" onchange="//Funktion zum profil ändern">
<option value="profile1">Menzer Tillmann</option>
<option value="profile2">Mustermann Max</option>
</select>
</div>
<div class="timerange-center">
<button class="timerange-controls">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="40" height="40">
<!-- Outer circle -->
<circle cx="50" cy="50" r="45" stroke="black" stroke-width="10" fill="none" />
<!-- Left arrow -->
<polygon points="30,50 50,30 50,40 70,40 70,60 50,60 50,70" fill="black" />
</svg>
</button>
<h2 class="timerange-item"><span id="startdate"></span></h2>
<h2 class="timerange-item">-</h2>
<h2 class="timerange-item"><span id="enddate"></span></h2>
<button class="timerange-controls">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="40" height="40"
class="timerange-controls">
<!-- Outer circle -->
<circle cx="50" cy="50" r="45" stroke="black" stroke-width="10" fill="none" />
<!-- Right arrow -->
<polygon points="70,50 50,30 50,40 30,40 30,60 50,60 50,70" fill="black" />
</svg>
</button>
</div>
<div class="controls-right">
<!-- <button class="buttons-right">
<img src="public/clipboard.png" width="auto" height="30">
</button>
<button class="buttons-right">
<img src="public/notifications.png" width="auto" height="30">
</button> -->
<button class="buttons-right" onclick="refreshAll()">
<img src="/public/refresh.png" width="auto" height="30">
</button>
<button class="buttons-right" onclick="(async () => { await logout(); })()">
<img src="/public/user.png" width="auto" height="30">
</button>
</div>
</div>
<div class="week-indicator">
<p id="week-indicator"></p>
</div>
</div>
<!-- TABLE -->
<div class="table-wrapper">
<table id="schedule">
<thead>
<tr class="mainheading-row">
<th><img src="/public/calendar.png" height="30px" width="auto" style="margin-top: 15px;" /></th>
<th>Montag</th>
<th>Dienstag</th>
<th>Mittwoch</th>
<th>Donnerstag</th>
<th>Freitag</th>
</tr>
<tr class="subheading-row">
<th></th>
<th><span id="cafepreview-mon"
onclick="window.generateCafePopup(datestringToReadable(getMenuDetails(dateToString(getMonday())).date), getMenuDetails(dateToString(getMonday())).mainDish, getMenuDetails(dateToString(getMonday())).mainDishVeg,getMenuDetails(dateToString(getMonday())).garnish , getMenuDetails(dateToString(getMonday())).dessert, getMenuDetails(dateToString(getMonday())).cookteam)"
style="cursor: pointer;"></span></th>
<th><span id="cafepreview-tue"
onclick="window.generateCafePopup(datestringToReadable(getMenuDetails(dateToString(getTuesday())).date), getMenuDetails(dateToString(getTuesday())).mainDish, getMenuDetails(dateToString(getTuesday())).mainDishVeg,getMenuDetails(dateToString(getTuesday())).garnish , getMenuDetails(dateToString(getTuesday())).dessert, getMenuDetails(dateToString(getTuesday())).cookteam)"
style="cursor: pointer;"></span></th>
<th><span id="cafepreview-wed"
onclick="window.generateCafePopup(datestringToReadable(getMenuDetails(dateToString(getMonday())).date), getMenuDetails(dateToString(getWednesday())).mainDish, getMenuDetails(dateToString(getWednesday())).mainDishVeg,getMenuDetails(dateToString(getWednesday())).garnish , getMenuDetails(dateToString(getWednesday())).dessert, getMenuDetails(dateToString(getWednesday())).cookteam)"
style="cursor: pointer;"></span></th>
<th><span id="cafepreview-thu"
onclick="window.generateCafePopup(datestringToReadable(getMenuDetails(dateToString(getThursday())).date), getMenuDetails(dateToString(getThursday())).mainDish, getMenuDetails(dateToString(getThursday())).mainDishVeg,getMenuDetails(dateToString(getThursday())).garnish , getMenuDetails(dateToString(getThursday())).dessert, getMenuDetails(dateToString(getThursday())).cookteam)"
style="cursor: pointer;"></span></th>
<th>Kein Kochtag</th>
</tr>
</thead>
<tbody id="scheduleBody">
<!-- Dynamic rows will be added here -->
<tr><td>1</td><td class="m1" colspan="1"></td><td class="t1" colspan="1"></td><td class="w1" colspan="1"></td><td class="th1" colspan="1"></td><td class="f1" colspan="1"></td></tr>
<tr><td>2</td><td class="m2" colspan="1"></td><td class="t2" colspan="1"></td><td class="w2" colspan="1"></td><td class="th2" colspan="1"></td><td class="f2" colspan="1"></td></tr>
<tr><td>3</td><td class="m3" colspan="1"></td><td class="t3" colspan="1"></td><td class="w3" colspan="1"></td><td class="th3" colspan="1"></td><td class="f3" colspan="1"></td></tr>
<tr><td>4</td><td class="m4" colspan="1"></td><td class="t4" colspan="1"></td><td class="w4" colspan="1"></td><td class="th4" colspan="1"></td><td class="f4" colspan="1"></td></tr>
<tr><td>5</td><td class="m5" colspan="1"></td><td class="t5" colspan="1"></td><td class="w5" colspan="1"></td><td class="th5" colspan="1"></td><td class="f5" colspan="1"></td></tr>
<tr><td>6</td><td class="m6" colspan="1"></td><td class="t6" colspan="1"></td><td class="w6" colspan="1"></td><td class="th6" colspan="1"></td><td class="f6" colspan="1"></td></tr>
<tr><td>7</td><td class="m7" colspan="1"></td><td class="t7" colspan="1"></td><td class="w7" colspan="1"></td><td class="th7" colspan="1"></td><td class="f7" colspan="1"></td></tr>
</tbody>
</table>
</div>
<div id="status-display">
<div id="loader" class="loader"></div>
<p><span id="status-display-text"></span></p>
</div>
<div id="error-display" style="display: none;">
<button id="close-button" onclick="closeErrorDisplay()">×</button>
<h4>Error:</h4>
<p><span id="error-display-text">Biiiig problem amogus just took over</span></p>
</div>
<!-- POPUPS -->
<!-- lesson -->
<div id="lesson-popup" class="popup-overlay">
<div class="popup-content" onclick="event.stopPropagation()">
<!-- Prevent the popup from closing when clicking inside -->
<button class="close-btn" onclick="window.closeLessonPopup()">×</button>
</div>
</div>
<!-- cafe -->
<div id="cafe-popup" class="popup-overlay">
<div class="popup-content" onclick="event.stopPropagation()">
<button class="close-btn" onclick="window.closeCafePopup()">×</button>
<div class="popup-centered">
<img src="/public/cafeteria_logo_weiss.png" alt="Treffpunkt Fanny" height="80px" width="auto">
<hr class="popup-divider">
<p id="date"></p>
</div>
<p><strong>Hauptgericht:</strong> <span id="main_dish"></span></p>
<p><strong>Vegetarisch:</strong> <span id="vegetarian_dish"></span></p>
<p><strong>Salat:</strong> <span id="salad"></span></p>
<p><strong>Nachtisch:</strong> <span id="desert"></span></p>
<p class="cooking-team"><strong>Kochteam:</strong> <span id="cooking_team"></span></p>
</div>
</div>
<script type="module" src="src/utils/utils.js"></script>
<script type="module" src="src/api/auth.js"></script>
<script type="module" src="src/api/other.js"></script>
<script type="module" src="src/index/table/statusDisplay.js"></script>
<script type="module" src="src/index/table/foodplan.js"></script>
<script type="module" src="src/api/refresh.js"></script>
<script type="module" src="src/index/table/generatePopup.js" defer></script>
<script type="module" src="src/index/table/generateTable.js" defer></script>
<script type="module" src="src/index/week.js" defer></script>
<script src="src/index/timeControl.js" defer></script>
<script defer>
window.onload = async function () {
if (!await isLoggedIn()) {
location.href = "/login.html";
return;
}
window.refreshAll();
setTopbarDate(datestringToReadableSHORT(getMonday()), datestringToReadableSHORT(getFriday()));
}
</script>
</body>
</html>