Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Portal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fachschaft
Portal
Merge requests
!16
Add link to the daily Mensa menu to one of the pages
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add link to the daily Mensa menu to one of the pages
36-add-the-daily-mensa-menu-to-one-of-the-pages
into
master
Overview
1
Commits
1
Pipelines
0
Changes
1
Merged
Jakob Moser
requested to merge
36-add-the-daily-mensa-menu-to-one-of-the-pages
into
master
9 months ago
Overview
1
Commits
1
Pipelines
0
Changes
1
Expand
See
#36
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
25fc5225
1 commit,
9 months ago
1 file
+
24
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
portal/static/js/components/pages/UniServices.mjs
+
24
−
0
Options
@@ -2,6 +2,22 @@ import { Service } from "../../model/Service.mjs"
import
{
ServiceLink
}
from
"
../pieces/ServiceLink.mjs
"
import
{
Base
}
from
"
./Base.mjs
"
const
germanDateFormatter
=
new
Intl
.
DateTimeFormat
(
"
de-DE
"
,
{
month
:
"
2-digit
"
,
day
:
"
2-digit
"
,
year
:
"
numeric
"
,
})
function
getMensaLink
()
{
const
dayToShow
=
new
Date
()
if
(
dayToShow
.
getHours
()
>=
15
)
{
// If it is 15:00 or later, show tomorrow's menu
dayToShow
.
setDate
(
dayToShow
.
getDate
()
+
1
)
}
return
`https://www.stw.uni-heidelberg.de/external-tools/speiseplan/speiseplan.php?lang=de&mode=Mensa+Im+Neuenheimer+Feld+304&date=
${
germanDateFormatter
.
format
(
dayToShow
)}
`
}
export
const
UniServices
=
{
oncreate
()
{
document
.
title
=
"
Uni-Dienste · FS Coli Portal
"
@@ -46,6 +62,14 @@ export const UniServices = {
"
Uni-ID
"
,
),
),
m
(
ServiceLink
,
new
Service
(
"
Mensa INF
"
,
getMensaLink
(),
"
fa-solid fa-utensils
"
,
),
),
]),
)
},
Loading