Skip to content

Commit

Permalink
Improve semester selection in home sidebar (#1139)
Browse files Browse the repository at this point in the history
Adds /20xx to all winter semesters in the semester selection sidebar.
Also increases bottom margin on the currently selected semester.
  • Loading branch information
JosefSchoenberger authored and SebiWrn committed May 7, 2024
1 parent 906272c commit ec03631
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions web/template/home.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
<i class="fa-solid fa-calendar"></i>
Semesters
</header>
<span class="tum-live-side-navigation-group-item mb-1 border-l-4 bg-blue-100/50 border-blue-500/50 dark:bg-indigo-500/25 dark:border-indigo-600/50"
<span class="tum-live-side-navigation-group-item mb-4 border-l-4 bg-blue-100/50 border-blue-500/50 dark:bg-indigo-500/25 dark:border-indigo-600/50"
x-text="semesters[selectedSemesterIndex]?.FriendlyString()"></span>
<template x-if="navigation.getChild('allSemesters').value">
<template x-for="s in semesters">
Expand Down Expand Up @@ -832,4 +832,4 @@
</div>
</div>
</div>
{{end}}
{{end}}
3 changes: 2 additions & 1 deletion web/ts/api/semesters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export class Semester {
}

public FriendlyString(): string {
return `${this.TeachingTerm === "W" ? "Winter" : "Summer"} ${this.Year}`;
if (this.TeachingTerm === "W") return `Winter ${this.Year}/` + `${this.Year + 1}`.slice(-2);
else return `Summer ${this.Year}`;
}
}

Expand Down

0 comments on commit ec03631

Please sign in to comment.