From 12587041ce7da1016a1a644303ddc10cfcc6547e Mon Sep 17 00:00:00 2001
From: ChefExperte <aago2001@web.de>
Date: Tue, 25 Jun 2024 19:16:56 +0200
Subject: [PATCH] Add calender tab showing coli calender at StuRa cloud

---
 portal/static/js/components/pages/Calendar.mjs | 18 ++++++++++++++++++
 portal/static/js/components/pieces/Nav.mjs     |  7 +++++++
 portal/static/js/portal.mjs                    |  2 ++
 3 files changed, 27 insertions(+)
 create mode 100644 portal/static/js/components/pages/Calendar.mjs

diff --git a/portal/static/js/components/pages/Calendar.mjs b/portal/static/js/components/pages/Calendar.mjs
new file mode 100644
index 0000000..c484e2b
--- /dev/null
+++ b/portal/static/js/components/pages/Calendar.mjs
@@ -0,0 +1,18 @@
+import { Base } from "./Base.mjs"
+
+export const Calendar = {
+    oncreate() {
+        document.title = "Kalender · FS Coli Portal"
+    },
+    view() {
+        return m(Base, [
+            m("section", [
+                m("iframe", {
+                  src: "https://cloud.stura.uni-heidelberg.de/index.php/apps/calendar/embed/HptQm9caKgi2kirx/dayGridMonth/now",
+                  style: {width: "90vw", height: "80vh", borderRadius: "20px", overflow: "hidden"},
+                  frameborder: "0"
+                })
+            ]),
+        ])
+    },
+}
diff --git a/portal/static/js/components/pieces/Nav.mjs b/portal/static/js/components/pieces/Nav.mjs
index 00d9aee..f07bdaf 100644
--- a/portal/static/js/components/pieces/Nav.mjs
+++ b/portal/static/js/components/pieces/Nav.mjs
@@ -54,6 +54,13 @@ export const Nav = {
                                 label: "Freischalten",
                             }),
                         ),
+                        m(
+                            "li",
+                            m(NavPageLink, {
+                                href: "/calendar",
+                                label: "Kalender",
+                            }),
+                        ),
                     ]),
                 ),
                 m(
diff --git a/portal/static/js/portal.mjs b/portal/static/js/portal.mjs
index c47a8e2..918077c 100644
--- a/portal/static/js/portal.mjs
+++ b/portal/static/js/portal.mjs
@@ -3,6 +3,7 @@ import { Uni } from "./components/pages/UniServices.mjs"
 import { Start } from "./components/pages/Start.mjs"
 import { Unlock } from "./components/pages/Unlock.mjs"
 import { Fachschaftssitzung } from "./components/pages/Fachschaftssitzung.mjs"
+import { Calendar } from "./components/pages/Calendar.mjs"
 import { Login } from "./components/pages/Login.mjs"
 import { Me } from "./components/pages/Me.mjs"
 import "/static/lib/mithril/mithril.min.js"
@@ -15,6 +16,7 @@ m.route(document.body, "/", {
     "/uni-services": Uni,
     "/unlock": Unlock,
     "/fachschaftssitzung": Fachschaftssitzung,
+    "/calendar": Calendar,
     "/login": Login,
     "/me": Me,
 })
-- 
GitLab