From 4b05babc1e5a4466028d7d210d9a7920a4a401f7 Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Sun, 19 Sep 2021 12:29:50 +0200 Subject: server, ics, pages: allow to generate ICS from modules This adds the ability to generate an ICS file from a module ID, and to filter it based on its groups. To do this, you can enter a module ID on the frontpage. Then, µCS will fetch the timetable, then return a page where one can select the group(s) they want to filter (this is enabled by the new Ics.get_all_groups function). Then, µCS is able to generate a link to that calendar, not unlike with a single group ID. Signed-off-by: Alban Gruin --- src/pages.ml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/pages.ml') diff --git a/src/pages.ml b/src/pages.ml index 2cb0aa4..feb2769 100644 --- a/src/pages.ml +++ b/src/pages.ml @@ -48,6 +48,11 @@ let main = common {| +
+ + + +

@@ -99,3 +104,18 @@ let link lnk = |} ^ lnk ^ {|

|} + +let select module_id groups = + let options = + Seq.map (fun group -> " ") groups + |> List.of_seq + |> String.concat "\n" in + common @@ {| +
+ + + +
+|} -- cgit v1.2.1