Pausen Updates

Pausenskalierung angepasst, Pausen werden nun in den Modulen angezeigt
This commit is contained in:
AliGitGut
2023-06-21 20:38:36 +02:00
parent d81922d188
commit 34c2786840
+19 -16
View File
@@ -180,20 +180,8 @@ export default function CalenderView(p) {
for (let j = 0; j < allEn.length; j++) { for (let j = 0; j < allEn.length; j++) {
if (allEn[j] != null && allEn[j].moduleid == moduleid) { if (allEn[j] != null && allEn[j].moduleid == moduleid) {
sum += allEn[j].timeend - allEn[j].timestart sum += allEn[j].timeend - allEn[j].timestart
checkTime = (allEn[j].timeend - allEn[j].timestart)/3 checkTime = Math.floor((allEn[j].timeend - allEn[j].timestart)/12)
if (checkTime >= 4){ sum -= checkTime
sum -= 1
/* Pause Info geben?
console.log(allEn[j].info + " 15 Minuten Pause")
allEn[j].info = allEn[j].info + "15 Minuten Pause"
*/
}else if (checkTime >= 8){
sum -= 2
}else if (checkTime >= 12){
sum -= 3
}
} }
} }
@@ -588,7 +576,6 @@ export default function CalenderView(p) {
}} }}
/> />
<p style={{ <p style={{
fontSize: 40, fontSize: 40,
marginBottom: 60 marginBottom: 60
@@ -667,6 +654,8 @@ export default function CalenderView(p) {
<div style={{maxHeight: "60%"}} className={"no-pointer-events"}> <div style={{maxHeight: "60%"}} className={"no-pointer-events"}>
<p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p> <p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p>
<p>{d.info}</p> <p>{d.info}</p>
<br/>
<p>{(Math.floor((d.timeend - d.timestart) / 12)) > 0 ? (Math.floor((d.timeend - d.timestart) / 12) * 15) + "min Pause Angerechnet" : ""}</p>
</div> </div>
<div className={"resize-grab"} id={"grabdown"} style={{ <div className={"resize-grab"} id={"grabdown"} style={{
backgroundColor: getResizeBarColor(d.usercreatedbyid, 0, d.semesterid, d.moduleid) backgroundColor: getResizeBarColor(d.usercreatedbyid, 0, d.semesterid, d.moduleid)
@@ -697,6 +686,8 @@ export default function CalenderView(p) {
<div style={{maxHeight: "60%"}} className={"no-pointer-events"}> <div style={{maxHeight: "60%"}} className={"no-pointer-events"}>
<p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p> <p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p>
<p>{d.info}</p> <p>{d.info}</p>
<br/>
<p>{(Math.floor((d.timeend - d.timestart) / 12)) > 0 ? (Math.floor((d.timeend - d.timestart) / 12) * 15) + "min Pause angerechnet" : ""}</p>
</div> </div>
<div className={"resize-grab"} id={"grabdown"} style={{ <div className={"resize-grab"} id={"grabdown"} style={{
backgroundColor: getResizeBarColor(d.usercreatedbyid, 1, d.semesterid, d.moduleid) backgroundColor: getResizeBarColor(d.usercreatedbyid, 1, d.semesterid, d.moduleid)
@@ -728,6 +719,8 @@ export default function CalenderView(p) {
<div style={{maxHeight: "60%"}} className={"no-pointer-events"}> <div style={{maxHeight: "60%"}} className={"no-pointer-events"}>
<p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p> <p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p>
<p>{d.info}</p> <p>{d.info}</p>
<br/>
<p>{(Math.floor((d.timeend - d.timestart) / 12)) > 0 ? (Math.floor((d.timeend - d.timestart) / 12) * 15) + "min Pause angerechnet" : ""}</p>
</div> </div>
<div className={"resize-grab"} id={"grabdown"} style={{ <div className={"resize-grab"} id={"grabdown"} style={{
backgroundColor: getResizeBarColor(d.usercreatedbyid, 2, d.semesterid, d.moduleid) backgroundColor: getResizeBarColor(d.usercreatedbyid, 2, d.semesterid, d.moduleid)
@@ -758,6 +751,8 @@ export default function CalenderView(p) {
<div style={{maxHeight: "60%"}} className={"no-pointer-events"}> <div style={{maxHeight: "60%"}} className={"no-pointer-events"}>
<p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p> <p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p>
<p>{d.info}</p> <p>{d.info}</p>
<br/>
<p>{(Math.floor((d.timeend - d.timestart) / 12)) > 0 ? (Math.floor((d.timeend - d.timestart) / 12) * 15) + "min Pause angerechnet" : ""}</p>
</div> </div>
<div className={"resize-grab"} id={"grabdown"} style={{ <div className={"resize-grab"} id={"grabdown"} style={{
backgroundColor: getResizeBarColor(d.usercreatedbyid, 3, d.semesterid, d.moduleid) backgroundColor: getResizeBarColor(d.usercreatedbyid, 3, d.semesterid, d.moduleid)
@@ -788,6 +783,8 @@ export default function CalenderView(p) {
<div style={{maxHeight: "60%"}} className={"no-pointer-events"}> <div style={{maxHeight: "60%"}} className={"no-pointer-events"}>
<p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p> <p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p>
<p>{d.info}</p> <p>{d.info}</p>
<br/>
<p>{(Math.floor((d.timeend - d.timestart) / 12)) > 0 ? (Math.floor((d.timeend - d.timestart) / 12) * 15) + "min Pause angerechnet" : ""}</p>
</div> </div>
<div className={"resize-grab"} id={"grabdown"} style={{ <div className={"resize-grab"} id={"grabdown"} style={{
backgroundColor: getResizeBarColor(d.usercreatedbyid, 4, d.semesterid, d.moduleid) backgroundColor: getResizeBarColor(d.usercreatedbyid, 4, d.semesterid, d.moduleid)
@@ -818,6 +815,8 @@ export default function CalenderView(p) {
<div style={{maxHeight: "60%"}} className={"no-pointer-events"}> <div style={{maxHeight: "60%"}} className={"no-pointer-events"}>
<p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p> <p>{internal_to_time(d.timestart) + " - " + internal_to_time(d.timeend)}</p>
<p>{d.info}</p> <p>{d.info}</p>
<br/>
<p>{(Math.floor((d.timeend - d.timestart) / 12)) > 0 ? (Math.floor((d.timeend - d.timestart) / 12) * 15) + "min Pause angerechnet" : ""}</p>
</div> </div>
<div className={"resize-grab"} id={"grabdown"} style={{ <div className={"resize-grab"} id={"grabdown"} style={{
backgroundColor: getResizeBarColor(d.usercreatedbyid, 5, d.semesterid, d.moduleid) backgroundColor: getResizeBarColor(d.usercreatedbyid, 5, d.semesterid, d.moduleid)
@@ -929,12 +928,16 @@ export default function CalenderView(p) {
</div> </div>
</div> </div>
<div className={"box-shadow round-border"} style={{
marginTop: 30,
padding: 5
}}>
<p style={{ <p style={{
display: typeof window !== "undefined" && localStorage.getItem("admin") == 0 ? "block" : "none", display: typeof window !== "undefined" && localStorage.getItem("admin") == 0 ? "block" : "none",
marginTop: 10,
fontSize: 20 fontSize: 20
}}>{Math.floor(timePlanned)} Vorlesungsstunden {(Math.floor(timePlanned * 3) - Math.floor(Math.floor(timePlanned) * 3)) * 15} min }}>{Math.floor(timePlanned)} Vorlesungsstunden {(Math.floor(timePlanned * 3) - Math.floor(Math.floor(timePlanned) * 3)) * 15} min
// 20 Vorlesungsstunden</p> // 20 Vorlesungsstunden</p>
</div>
<div style={{ <div style={{
display: typeof window !== "undefined" && localStorage.getItem("admin") == 0 ? "block" : "none", display: typeof window !== "undefined" && localStorage.getItem("admin") == 0 ? "block" : "none",