forked from DGNum/metis
Compare commits
50 commits
thubrecht/
...
master
Author | SHA1 | Date | |
---|---|---|---|
7c256a6dcc | |||
|
dbfd1de2b9 | ||
a14d334c75 | |||
|
1a151d6cf4 | ||
|
b5b9941560 | ||
c444b702b2 | |||
d5a7f39384 | |||
f086aab2bf | |||
|
85570af7af | ||
1a225d10ca | |||
|
7c5df4e790 | ||
ab00fede2e | |||
32d9b4d60c | |||
642b45f018 | |||
49d62aa749 | |||
ea468c2469 | |||
|
8d0c245e35 | ||
|
22b5ee34d5 | ||
|
4143cb84c2 | ||
4f72214717 | |||
cfd94cb02a | |||
|
d4254e19fd | ||
64534b2bf7 | |||
871b7eaaf8 | |||
7d2662d00a | |||
|
629bb480ea | ||
86da9646d8 | |||
|
05c7174f5f | ||
7ce999c365 | |||
|
985e6561b8 | ||
f9ebe70653 | |||
|
036ba938ae | ||
4af6452003 | |||
|
0e172f5569 | ||
aa697799bc | |||
58597c8076 | |||
142b841397 | |||
75e9a5c281 | |||
|
d958b817f3 | ||
06ef17e8f5 | |||
|
a5353b0c9e | ||
|
b40b7494a4 | ||
26cb575a54 | |||
3e84c21e00 | |||
|
4a1e24c1d3 | ||
3a2502acbe | |||
7eb5ee2dfd | |||
|
5c415b6a04 | ||
|
4444649136 | ||
e420cdd0b4 |
19 changed files with 807 additions and 3782 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
||||||
node_modules
|
node_modules
|
||||||
public/build
|
public/build
|
||||||
|
result
|
||||||
|
|
||||||
.direnv
|
.direnv
|
198
data/calendars.json
Normal file
198
data/calendars.json
Normal file
|
@ -0,0 +1,198 @@
|
||||||
|
{
|
||||||
|
"tree": {
|
||||||
|
"Rentrée": {
|
||||||
|
"Amphis de rentrée": {},
|
||||||
|
"Départements": {},
|
||||||
|
"Visites de bibliothèque": {},
|
||||||
|
"Masters": {},
|
||||||
|
"Étudiants internationaux": {},
|
||||||
|
"Conférences de recherche": {}
|
||||||
|
},
|
||||||
|
"COF": {
|
||||||
|
"Rentrée du COF": {},
|
||||||
|
"Évènements (COF)": {},
|
||||||
|
"Assemblées Générales (COF)": {},
|
||||||
|
"BdA": {
|
||||||
|
"Évènements (BdA)": {},
|
||||||
|
"Spectacles du tirage BdA": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Clubs COF": {
|
||||||
|
"PLS": {},
|
||||||
|
"HackENS": {},
|
||||||
|
"Club Bouffe": {},
|
||||||
|
"Écriv'ENS": {},
|
||||||
|
"BOcal": {},
|
||||||
|
"CinéClub": {},
|
||||||
|
"Ernestophone": {},
|
||||||
|
"Club Jeux": {},
|
||||||
|
"DDR": {},
|
||||||
|
"BandarrêtdurgENS": {},
|
||||||
|
"L'Hômonerie": {},
|
||||||
|
"Ulmity": {},
|
||||||
|
"Arts pla'": {},
|
||||||
|
"Club Inutile ☔": {}
|
||||||
|
},
|
||||||
|
"BDS": {
|
||||||
|
"Évènements (BDS)": {},
|
||||||
|
"Rentrée du BDS": {}
|
||||||
|
},
|
||||||
|
"Clubs BDS": {
|
||||||
|
"Créneaux encadrés": {},
|
||||||
|
"ENSelle": {}
|
||||||
|
},
|
||||||
|
"La Nuit de l'ENS": {},
|
||||||
|
"Délégation Générale": {},
|
||||||
|
"K-Fêt": {},
|
||||||
|
"Écocampus": {},
|
||||||
|
"La Psychédéliste":{},
|
||||||
|
"Ambassadeur·rice·s santé": {}
|
||||||
|
},
|
||||||
|
|
||||||
|
"sources": {
|
||||||
|
"eleves-ens": {
|
||||||
|
"qG6jpJPfK37Nw8ZC": {
|
||||||
|
"name": "PLS"
|
||||||
|
},
|
||||||
|
"caey6jt6pTgKengA": {
|
||||||
|
"name": "BOcal",
|
||||||
|
"color": "#e6973e"
|
||||||
|
},
|
||||||
|
"LLWm8qK9iC5YGrrR": {
|
||||||
|
"name": "Délégation Générale",
|
||||||
|
"short_name": "DG"
|
||||||
|
},
|
||||||
|
"2KGkWzBJGorxzyTW": {
|
||||||
|
"name": "La Nuit de l'ENS",
|
||||||
|
"short_name": "La Nuit"
|
||||||
|
},
|
||||||
|
"w442JdS5AaQ6czrP": {
|
||||||
|
"name": "Écriv'ENS"
|
||||||
|
},
|
||||||
|
"QXGnDTA8GS6r876F": {
|
||||||
|
"name": "K-Fêt",
|
||||||
|
"color": "#c63b52",
|
||||||
|
"default_location": "K-Fêt"
|
||||||
|
},
|
||||||
|
"gsZtZK8c9EmREofn": {
|
||||||
|
"name": "Ernestophone"
|
||||||
|
},
|
||||||
|
"dTHrXnYgsEoSTjWB": {
|
||||||
|
"name": "Évènements (COF)",
|
||||||
|
"short_name": "COF"
|
||||||
|
},
|
||||||
|
"bCgRFByHLiCCNc55": {
|
||||||
|
"name": "Assemblées Générales (COF)",
|
||||||
|
"short_name": "AG COF"
|
||||||
|
},
|
||||||
|
"r4yJZDHjwNtH8wkR": {
|
||||||
|
"name": "Évènements (BdA)"
|
||||||
|
},
|
||||||
|
"83AkowSYPnYrjSFr": {
|
||||||
|
"name": "Spectacles du tirage BdA",
|
||||||
|
"short_name": "Spectacles",
|
||||||
|
"initial": false
|
||||||
|
},
|
||||||
|
"ZtWm3MYSi388k2yk": {
|
||||||
|
"name": "DDR"
|
||||||
|
},
|
||||||
|
"T5WoHbs4FT5A945Z": {
|
||||||
|
"name": "CinéClub"
|
||||||
|
},
|
||||||
|
"6SHG6cg9d7S3qqwD": {
|
||||||
|
"name": "Club Inutile ☔",
|
||||||
|
"initial": false
|
||||||
|
},
|
||||||
|
"TFjE83ASCMK9rfRi": {
|
||||||
|
"name": "BandarrêtdurgENS",
|
||||||
|
"short_name": "Banda"
|
||||||
|
},
|
||||||
|
"kR8fMzmf4ciop9Je": {
|
||||||
|
"name": "Club Jeux",
|
||||||
|
"short_name": "Jeux",
|
||||||
|
"color": "#5f9ae0"
|
||||||
|
},
|
||||||
|
"22rQF3gjjz8LifZC": {
|
||||||
|
"name": "La Psychédéliste",
|
||||||
|
"short_name": "Psychédéliste"
|
||||||
|
},
|
||||||
|
"AfHYkm3gqQ4fRRj5": {
|
||||||
|
"name": "HackENS",
|
||||||
|
"default_location": "Cave d'hackENS"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"frama-agenda": {
|
||||||
|
"qZcPZdGb5YtJHrNZ": {
|
||||||
|
"name": "ENSelle"
|
||||||
|
},
|
||||||
|
"K6iGBG47WXaKWs3Q": {
|
||||||
|
"name": "Créneaux encadrés"
|
||||||
|
},
|
||||||
|
"TFjE83ASCMK9rfRi": {
|
||||||
|
"name": "BandarrêtdurgENS",
|
||||||
|
"short_name": "Banda"
|
||||||
|
},
|
||||||
|
"dSYCtdC6bgyWpKyt": {
|
||||||
|
"name": "Évènements (BDS)"
|
||||||
|
},
|
||||||
|
"goXLq2dQ8LgFAjkM": {
|
||||||
|
"name": "Club Bouffe"
|
||||||
|
},
|
||||||
|
"Q8w6dw4jGLBP9ftB": {
|
||||||
|
"name": "Écocampus"
|
||||||
|
},
|
||||||
|
"T5WoHbs4FT5A945Z": {
|
||||||
|
"name": "CinéClub"
|
||||||
|
},
|
||||||
|
"zmgdYw62RatzmGDt": {
|
||||||
|
"name": "Ulmity"
|
||||||
|
},
|
||||||
|
"iXGysEGxo7EsKjwG": {
|
||||||
|
"name": "Ambassadeur·rice·s santé",
|
||||||
|
"short_name": "Amba. santé",
|
||||||
|
"color": "#f5a142"
|
||||||
|
},
|
||||||
|
"AYNpoC674yAjEmRy": {
|
||||||
|
"name": "L'Hômonerie"
|
||||||
|
},
|
||||||
|
"TcwNdrs6iyBRxFzk": {
|
||||||
|
"name": "Divers"
|
||||||
|
},
|
||||||
|
"G5ZRyTkMifXC2iHj": {
|
||||||
|
"name": "Amphis de rentrée",
|
||||||
|
"short_name": "Amphis"
|
||||||
|
},
|
||||||
|
"dJofECeczaGgNiKs": {
|
||||||
|
"name": "Rentrée du BDS",
|
||||||
|
"short_name": "BDS"
|
||||||
|
},
|
||||||
|
"7Rwd8JERwBsso7XG": {
|
||||||
|
"name": "Rentrée du COF",
|
||||||
|
"short_name": "COF"
|
||||||
|
},
|
||||||
|
"tiMsNcncqBxR4nL2": {
|
||||||
|
"name": "Départements",
|
||||||
|
"short_name": "Dpt"
|
||||||
|
},
|
||||||
|
"RpP773D6e2ReLfcY": {
|
||||||
|
"name": "Visites de bibliothèque",
|
||||||
|
"short_name": "Bibli"
|
||||||
|
},
|
||||||
|
"YRZ4A8imEEf8jnDE": {
|
||||||
|
"name": "Masters"
|
||||||
|
},
|
||||||
|
"8EDHX6kiPYcSrXXL": {
|
||||||
|
"name": "Étudiants internationaux",
|
||||||
|
"short_name": "Internationaux"
|
||||||
|
},
|
||||||
|
"TWgNxdri7zQSoiRf": {
|
||||||
|
"name": "Conférences de recherche",
|
||||||
|
"short_name": "Conf"
|
||||||
|
},
|
||||||
|
"MJf2wnQafbLc2arS": {
|
||||||
|
"name": "Arts pla'",
|
||||||
|
"color": "#ffb969"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
47
data/locations.json
Normal file
47
data/locations.json
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
{
|
||||||
|
"nameMap": {
|
||||||
|
"Amphi Jourdan": "Amphithéâtre Jourdan",
|
||||||
|
"Cour aux Ernest": "Cour aux Ernests",
|
||||||
|
"R2-21 (Jourdan)": "R2-21",
|
||||||
|
"Salle Jean Ibanes (Jourdan, R1-07)": "Salle Jean Ibanes (R1-07)",
|
||||||
|
"Salle Madeleine Rebérioux (Jourdan, R2-02)": "Salle Madeleine Rebérioux (R2-02)",
|
||||||
|
"Salle Marcel Roncayolo (Jourdan, R2-05)": "Salle Marcel Roncayolo (R2-05)",
|
||||||
|
"Cour des bibliothèques": "Cour du NIR"
|
||||||
|
},
|
||||||
|
|
||||||
|
"rooms": {
|
||||||
|
"45 rue d'Ulm": [
|
||||||
|
"Amphithéâtre Galois",
|
||||||
|
"Bibliothèque Lettres",
|
||||||
|
"Salle Histoire",
|
||||||
|
"Salle Aron",
|
||||||
|
"Salle Cavaillès",
|
||||||
|
"Salle Dussane",
|
||||||
|
"Salle des Actes",
|
||||||
|
"Salle des Résistants",
|
||||||
|
"Salle Cavaillès",
|
||||||
|
"Salle Cartan",
|
||||||
|
"Salle Noether",
|
||||||
|
"Salle Bourbaki",
|
||||||
|
"Cour aux Ernests",
|
||||||
|
"Cour du NIR",
|
||||||
|
"Cour Pasteur",
|
||||||
|
"Pôt",
|
||||||
|
"Petit pôt",
|
||||||
|
"Canopée",
|
||||||
|
"K-Fêt",
|
||||||
|
"Cave d'hackENS",
|
||||||
|
"Gymnase"
|
||||||
|
],
|
||||||
|
"24 rue Lhomond": ["Salle CONF IV"],
|
||||||
|
"29 rue d'Ulm": ["Bibliothèque des sciences expérimentales", "Salle Jaurès"],
|
||||||
|
"Jourdan": [
|
||||||
|
"Bibliothèque de Jourdan",
|
||||||
|
"Salle Marcel Roncayolo (R2-05)",
|
||||||
|
"Salle Madeleine Rebérioux (R2-02)",
|
||||||
|
"Amphithéâtre Jourdan",
|
||||||
|
"R2-21",
|
||||||
|
"Salle Jean Ibanes"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
12
default.nix
12
default.nix
|
@ -1,9 +1,13 @@
|
||||||
{ pkgs ? import ./nix {} }:
|
{ pkgs ? import (import ./npins).nixpkgs {} }:
|
||||||
{
|
{
|
||||||
production = pkgs.npmlock2nix.build {
|
production = pkgs.buildNpmPackage {
|
||||||
|
name = "metis";
|
||||||
src = ./.;
|
src = ./.;
|
||||||
installPhase = "cp -r public/build $out";
|
npmDepsHash = "sha256-RbjWNVY8KlPP9ajQRnrsWhOZiiyyMGQSY39lmZnTC1I=";
|
||||||
buildCommands = [ "npm run build" ];
|
installPhase = ''
|
||||||
|
cp -r public $out
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
shell = import ./shell.nix { inherit pkgs; };
|
shell = import ./shell.nix { inherit pkgs; };
|
||||||
|
providers = import ./providers.nix;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
# nix/default.nix
|
|
||||||
{ pkgs ? import <nixpkgs> {} }:
|
|
||||||
let
|
|
||||||
sources = import ./sources.nix;
|
|
||||||
in
|
|
||||||
import sources.nixpkgs {
|
|
||||||
overlays = [
|
|
||||||
(self: super: {
|
|
||||||
npmlock2nix = pkgs.callPackage sources.npmlock2nix { };
|
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
{
|
|
||||||
"niv": {
|
|
||||||
"branch": "master",
|
|
||||||
"description": "Easy dependency management for Nix projects",
|
|
||||||
"homepage": "https://github.com/nmattia/niv",
|
|
||||||
"owner": "nmattia",
|
|
||||||
"repo": "niv",
|
|
||||||
"rev": "5830a4dd348d77e39a0f3c4c762ff2663b602d4c",
|
|
||||||
"sha256": "1d3lsrqvci4qz2hwjrcnd8h5vfkg8aypq3sjd4g3izbc8frwz5sm",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/nmattia/niv/archive/5830a4dd348d77e39a0f3c4c762ff2663b602d4c.tar.gz",
|
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
|
||||||
"branch": "master",
|
|
||||||
"description": "Nix Packages collection",
|
|
||||||
"homepage": "",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "21.05",
|
|
||||||
"sha256": "1ckzhh24mgz6jd1xhfgx0i9mijk6xjqxwsshnvq789xsavrmsc36",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/nixos/nixpkgs/archive/21.05.tar.gz",
|
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
|
||||||
},
|
|
||||||
"npmlock2nix": {
|
|
||||||
"branch": "master",
|
|
||||||
"description": null,
|
|
||||||
"homepage": null,
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "npmlock2nix",
|
|
||||||
"rev": "ff17a3c59233911f776d8d462d61d82a3e41df34",
|
|
||||||
"sha256": "0l624gkkpn1r0g48b204k0wcqm9cwy5rzd5mnxwfjhyjj1wg4nl7",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/nix-community/npmlock2nix/archive/ff17a3c59233911f776d8d462d61d82a3e41df34.tar.gz",
|
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
|
||||||
}
|
|
||||||
}
|
|
174
nix/sources.nix
174
nix/sources.nix
|
@ -1,174 +0,0 @@
|
||||||
# This file has been generated by Niv.
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
#
|
|
||||||
# The fetchers. fetch_<type> fetches specs of type <type>.
|
|
||||||
#
|
|
||||||
|
|
||||||
fetch_file = pkgs: name: spec:
|
|
||||||
let
|
|
||||||
name' = sanitizeName name + "-src";
|
|
||||||
in
|
|
||||||
if spec.builtin or true then
|
|
||||||
builtins_fetchurl { inherit (spec) url sha256; name = name'; }
|
|
||||||
else
|
|
||||||
pkgs.fetchurl { inherit (spec) url sha256; name = name'; };
|
|
||||||
|
|
||||||
fetch_tarball = pkgs: name: spec:
|
|
||||||
let
|
|
||||||
name' = sanitizeName name + "-src";
|
|
||||||
in
|
|
||||||
if spec.builtin or true then
|
|
||||||
builtins_fetchTarball { name = name'; inherit (spec) url sha256; }
|
|
||||||
else
|
|
||||||
pkgs.fetchzip { name = name'; inherit (spec) url sha256; };
|
|
||||||
|
|
||||||
fetch_git = name: spec:
|
|
||||||
let
|
|
||||||
ref =
|
|
||||||
if spec ? ref then spec.ref else
|
|
||||||
if spec ? branch then "refs/heads/${spec.branch}" else
|
|
||||||
if spec ? tag then "refs/tags/${spec.tag}" else
|
|
||||||
abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!";
|
|
||||||
in
|
|
||||||
builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; };
|
|
||||||
|
|
||||||
fetch_local = spec: spec.path;
|
|
||||||
|
|
||||||
fetch_builtin-tarball = name: throw
|
|
||||||
''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`.
|
|
||||||
$ niv modify ${name} -a type=tarball -a builtin=true'';
|
|
||||||
|
|
||||||
fetch_builtin-url = name: throw
|
|
||||||
''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`.
|
|
||||||
$ niv modify ${name} -a type=file -a builtin=true'';
|
|
||||||
|
|
||||||
#
|
|
||||||
# Various helpers
|
|
||||||
#
|
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695
|
|
||||||
sanitizeName = name:
|
|
||||||
(
|
|
||||||
concatMapStrings (s: if builtins.isList s then "-" else s)
|
|
||||||
(
|
|
||||||
builtins.split "[^[:alnum:]+._?=-]+"
|
|
||||||
((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
# The set of packages used when specs are fetched using non-builtins.
|
|
||||||
mkPkgs = sources: system:
|
|
||||||
let
|
|
||||||
sourcesNixpkgs =
|
|
||||||
import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; };
|
|
||||||
hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
|
|
||||||
hasThisAsNixpkgsPath = <nixpkgs> == ./.;
|
|
||||||
in
|
|
||||||
if builtins.hasAttr "nixpkgs" sources
|
|
||||||
then sourcesNixpkgs
|
|
||||||
else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then
|
|
||||||
import <nixpkgs> {}
|
|
||||||
else
|
|
||||||
abort
|
|
||||||
''
|
|
||||||
Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or
|
|
||||||
add a package called "nixpkgs" to your sources.json.
|
|
||||||
'';
|
|
||||||
|
|
||||||
# The actual fetching function.
|
|
||||||
fetch = pkgs: name: spec:
|
|
||||||
|
|
||||||
if ! builtins.hasAttr "type" spec then
|
|
||||||
abort "ERROR: niv spec ${name} does not have a 'type' attribute"
|
|
||||||
else if spec.type == "file" then fetch_file pkgs name spec
|
|
||||||
else if spec.type == "tarball" then fetch_tarball pkgs name spec
|
|
||||||
else if spec.type == "git" then fetch_git name spec
|
|
||||||
else if spec.type == "local" then fetch_local spec
|
|
||||||
else if spec.type == "builtin-tarball" then fetch_builtin-tarball name
|
|
||||||
else if spec.type == "builtin-url" then fetch_builtin-url name
|
|
||||||
else
|
|
||||||
abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}";
|
|
||||||
|
|
||||||
# If the environment variable NIV_OVERRIDE_${name} is set, then use
|
|
||||||
# the path directly as opposed to the fetched source.
|
|
||||||
replace = name: drv:
|
|
||||||
let
|
|
||||||
saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name;
|
|
||||||
ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}";
|
|
||||||
in
|
|
||||||
if ersatz == "" then drv else
|
|
||||||
# this turns the string into an actual Nix path (for both absolute and
|
|
||||||
# relative paths)
|
|
||||||
if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}";
|
|
||||||
|
|
||||||
# Ports of functions for older nix versions
|
|
||||||
|
|
||||||
# a Nix version of mapAttrs if the built-in doesn't exist
|
|
||||||
mapAttrs = builtins.mapAttrs or (
|
|
||||||
f: set: with builtins;
|
|
||||||
listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set))
|
|
||||||
);
|
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295
|
|
||||||
range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1);
|
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257
|
|
||||||
stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1));
|
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269
|
|
||||||
stringAsChars = f: s: concatStrings (map f (stringToCharacters s));
|
|
||||||
concatMapStrings = f: list: concatStrings (map f list);
|
|
||||||
concatStrings = builtins.concatStringsSep "";
|
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331
|
|
||||||
optionalAttrs = cond: as: if cond then as else {};
|
|
||||||
|
|
||||||
# fetchTarball version that is compatible between all the versions of Nix
|
|
||||||
builtins_fetchTarball = { url, name ? null, sha256 }@attrs:
|
|
||||||
let
|
|
||||||
inherit (builtins) lessThan nixVersion fetchTarball;
|
|
||||||
in
|
|
||||||
if lessThan nixVersion "1.12" then
|
|
||||||
fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
|
|
||||||
else
|
|
||||||
fetchTarball attrs;
|
|
||||||
|
|
||||||
# fetchurl version that is compatible between all the versions of Nix
|
|
||||||
builtins_fetchurl = { url, name ? null, sha256 }@attrs:
|
|
||||||
let
|
|
||||||
inherit (builtins) lessThan nixVersion fetchurl;
|
|
||||||
in
|
|
||||||
if lessThan nixVersion "1.12" then
|
|
||||||
fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
|
|
||||||
else
|
|
||||||
fetchurl attrs;
|
|
||||||
|
|
||||||
# Create the final "sources" from the config
|
|
||||||
mkSources = config:
|
|
||||||
mapAttrs (
|
|
||||||
name: spec:
|
|
||||||
if builtins.hasAttr "outPath" spec
|
|
||||||
then abort
|
|
||||||
"The values in sources.json should not have an 'outPath' attribute"
|
|
||||||
else
|
|
||||||
spec // { outPath = replace name (fetch config.pkgs name spec); }
|
|
||||||
) config.sources;
|
|
||||||
|
|
||||||
# The "config" used by the fetchers
|
|
||||||
mkConfig =
|
|
||||||
{ sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null
|
|
||||||
, sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile)
|
|
||||||
, system ? builtins.currentSystem
|
|
||||||
, pkgs ? mkPkgs sources system
|
|
||||||
}: rec {
|
|
||||||
# The sources, i.e. the attribute set of spec name to spec
|
|
||||||
inherit sources;
|
|
||||||
|
|
||||||
# The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers
|
|
||||||
inherit pkgs;
|
|
||||||
};
|
|
||||||
|
|
||||||
in
|
|
||||||
mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }
|
|
47
npins/default.nix
Normal file
47
npins/default.nix
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
# Generated by npins. Do not modify; will be overwritten regularly
|
||||||
|
let
|
||||||
|
data = builtins.fromJSON (builtins.readFile ./sources.json);
|
||||||
|
version = data.version;
|
||||||
|
|
||||||
|
mkSource = spec:
|
||||||
|
assert spec ? type; let
|
||||||
|
path =
|
||||||
|
if spec.type == "Git" then mkGitSource spec
|
||||||
|
else if spec.type == "GitRelease" then mkGitSource spec
|
||||||
|
else if spec.type == "PyPi" then mkPyPiSource spec
|
||||||
|
else if spec.type == "Channel" then mkChannelSource spec
|
||||||
|
else builtins.throw "Unknown source type ${spec.type}";
|
||||||
|
in
|
||||||
|
spec // { outPath = path; };
|
||||||
|
|
||||||
|
mkGitSource = { repository, revision, url ? null, hash, ... }:
|
||||||
|
assert repository ? type;
|
||||||
|
# At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository
|
||||||
|
# In the latter case, there we will always be an url to the tarball
|
||||||
|
if url != null then
|
||||||
|
(builtins.fetchTarball {
|
||||||
|
inherit url;
|
||||||
|
sha256 = hash; # FIXME: check nix version & use SRI hashes
|
||||||
|
})
|
||||||
|
else assert repository.type == "Git"; builtins.fetchGit {
|
||||||
|
url = repository.url;
|
||||||
|
rev = revision;
|
||||||
|
# hash = hash;
|
||||||
|
};
|
||||||
|
|
||||||
|
mkPyPiSource = { url, hash, ... }:
|
||||||
|
builtins.fetchurl {
|
||||||
|
inherit url;
|
||||||
|
sha256 = hash;
|
||||||
|
};
|
||||||
|
|
||||||
|
mkChannelSource = { url, hash, ... }:
|
||||||
|
builtins.fetchTarball {
|
||||||
|
inherit url;
|
||||||
|
sha256 = hash;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
if version == 3 then
|
||||||
|
builtins.mapAttrs (_: mkSource) data.pins
|
||||||
|
else
|
||||||
|
throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`"
|
11
npins/sources.json
Normal file
11
npins/sources.json
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"pins": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"type": "Channel",
|
||||||
|
"name": "nixpkgs-unstable",
|
||||||
|
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-23.11pre506449.f465da16626/nixexprs.tar.xz",
|
||||||
|
"hash": "14jsw1gv83qjz82384gfhn78sv9m14i1bs5l97xrab26vyi9b5ay"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"version": 3
|
||||||
|
}
|
3748
package-lock.json
generated
3748
package-lock.json
generated
File diff suppressed because it is too large
Load diff
7
providers.nix
Normal file
7
providers.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
let
|
||||||
|
providers = {
|
||||||
|
eleves-ens = "cloud.eleves.ens.fr";
|
||||||
|
frama-agenda = "framagenda.org";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
builtins.mapAttrs (name: value: "https://${value}/remote.php/dav/public-calendars/") providers
|
BIN
public.tar.gz
BIN
public.tar.gz
Binary file not shown.
|
@ -4,7 +4,7 @@
|
||||||
<meta charset='utf-8'>
|
<meta charset='utf-8'>
|
||||||
<meta name='viewport' content='width=device-width,initial-scale=1'>
|
<meta name='viewport' content='width=device-width,initial-scale=1'>
|
||||||
|
|
||||||
<title>Calendrier du Club Réseau</title>
|
<title>Calendrier de la DGNum</title>
|
||||||
|
|
||||||
<link rel='icon' href='/favicon.svg'>
|
<link rel='icon' href='/favicon.svg'>
|
||||||
<link rel='stylesheet' href='/global.css'>
|
<link rel='stylesheet' href='/global.css'>
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{ pkgs ? import ./nix {} }:
|
{ pkgs ? import (import ./npins).nixpkgs {} }:
|
||||||
pkgs.npmlock2nix.shell {
|
pkgs.mkShell {
|
||||||
src = ./.;
|
packages = [ pkgs.nodejs ];
|
||||||
nodejs = pkgs.nodejs-14_x;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
import bootstrap5Plugin from '@fullcalendar/bootstrap5';
|
import bootstrap5Plugin from '@fullcalendar/bootstrap5';
|
||||||
import { Tooltip } from 'bootstrap';
|
import { Tooltip } from 'bootstrap';
|
||||||
|
|
||||||
import ENSLocations from './static-ens-locations.json';
|
import LOCATIONS from '../data/locations.json';
|
||||||
|
|
||||||
const event = writable(null);
|
const event = writable(null);
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@
|
||||||
scrollTime: '08:00:00',
|
scrollTime: '08:00:00',
|
||||||
resourceGroupField: 'building',
|
resourceGroupField: 'building',
|
||||||
resourceAreaWidth: '27%',
|
resourceAreaWidth: '27%',
|
||||||
resources: Object.entries(ENSLocations).flatMap(([building, rooms]) =>
|
resources: Object.entries(LOCATIONS.rooms).flatMap(([building, rooms]) =>
|
||||||
rooms.map(room => ({
|
rooms.map(room => ({
|
||||||
id: `${building}-${room}`,
|
id: `${building}-${room}`,
|
||||||
building,
|
building,
|
||||||
|
@ -121,6 +121,11 @@
|
||||||
isLoading = b;
|
isLoading = b;
|
||||||
if (spinner) {
|
if (spinner) {
|
||||||
spinner.$set({ isLoading: b });
|
spinner.$set({ isLoading: b });
|
||||||
|
if (b) {
|
||||||
|
setTimeout(() => {
|
||||||
|
spinner.$set({ isLoading: false });
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
eventSources: [],
|
eventSources: [],
|
||||||
|
@ -129,11 +134,14 @@
|
||||||
progressiveEventRendering: true,
|
progressiveEventRendering: true,
|
||||||
expandRows: true,
|
expandRows: true,
|
||||||
eventDidMount: info => {
|
eventDidMount: info => {
|
||||||
new Tooltip(info.el, {
|
const title = info.event.extendedProps.short_name;
|
||||||
title: info.event.extendedProps.short_name,
|
if (title !== undefined) {
|
||||||
trigger: 'hover',
|
new Tooltip(info.el, {
|
||||||
placement: 'top'
|
title: title,
|
||||||
});
|
trigger: 'hover',
|
||||||
|
placement: 'top'
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
viewDidMount: arg => {
|
viewDidMount: arg => {
|
||||||
spinner = new Spinner({
|
spinner = new Spinner({
|
||||||
|
@ -196,6 +204,8 @@
|
||||||
<FullCalendar bind:this={calendar} options={$options} />
|
<FullCalendar bind:this={calendar} options={$options} />
|
||||||
|
|
||||||
<EventModal event={$event} open={openModal} {toggle} />
|
<EventModal event={$event} open={openModal} {toggle} />
|
||||||
|
|
||||||
|
<script defer data-domain="calendrier.dgnum.eu" src="https://analytics.dgnum.eu/js/script.js"></script>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
@ -56,7 +56,10 @@
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span>
|
<span>
|
||||||
{#if event.allDay}
|
{#if event.extendedProps.simAllDay}
|
||||||
|
<Icon name="calendar-range" class="text-primary" />
|
||||||
|
<span class="ms-1">{dateFormat(event.start)} ({timeFormat(event.extendedProps.realStart)}) - {dateFormat(event.end)} ({timeFormat(event.extendedProps.realEnd)})</span>
|
||||||
|
{:else if event.allDay}
|
||||||
<Icon name="calendar-range" class="text-primary" />
|
<Icon name="calendar-range" class="text-primary" />
|
||||||
<span class="ms-1">{dateFormat(event.start)} - {dateFormat(event.end)}</span>
|
<span class="ms-1">{dateFormat(event.start)} - {dateFormat(event.end)}</span>
|
||||||
{:else}
|
{:else}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
<ModalBody>
|
<ModalBody>
|
||||||
<p>Calendrier commun de la vie étudiante de l'ENS</p>
|
<p>Calendrier commun de la vie étudiante de l'ENS</p>
|
||||||
<b>Comment rajouter son calendrier :</b>
|
<b>Comment rajouter son calendrier :</b>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
Utiliser un NextCloud, idéalement
|
Utiliser un NextCloud, idéalement
|
||||||
|
@ -26,15 +26,18 @@
|
||||||
</li>
|
</li>
|
||||||
<li>Créer un calendrier dessus, créer un lien de partage public.</li>
|
<li>Créer un calendrier dessus, créer un lien de partage public.</li>
|
||||||
<li>
|
<li>
|
||||||
Envoyer le lien de partage public au Club Réseau<br />
|
Envoyer le lien de partage public à la DGNum<br />
|
||||||
(club-reseau [at] lists [.] ens [.] psl [.] eu) pour faire une requête d'ajout.
|
(calendrier [at] dgnum [.] eu) pour faire une requête d'ajout.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<p>Code source :
|
||||||
|
<a href="https://git.dgnum.eu/DGNum/metis">https://git.dgnum.eu/DGNum/metis</a>
|
||||||
|
</p>
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
|
|
||||||
<ModalFooter>
|
<ModalFooter>
|
||||||
<Icon name="balloon-heart" class="text-danger fs-5" />
|
<Icon name="balloon-heart" class="text-danger fs-5" />
|
||||||
<span class="fs-7">Propulsé par le Club Réseau de l'ENS</span>
|
<span class="fs-7">Propulsé par la <a href="https://dgnum.eu">Délégation Générale Numérique</a></span>
|
||||||
</ModalFooter>
|
</ModalFooter>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
|
|
209
src/calendar.js
209
src/calendar.js
|
@ -1,4 +1,5 @@
|
||||||
import STATIC_LOCATIONS from './static-ens-locations.json'
|
import CALENDARS from '../data/calendars.json'
|
||||||
|
import LOCATIONS from '../data/locations.json'
|
||||||
|
|
||||||
// https://stackoverflow.com/a/35970186
|
// https://stackoverflow.com/a/35970186
|
||||||
function invertColor(hex) {
|
function invertColor(hex) {
|
||||||
|
@ -19,140 +20,19 @@ function invertColor(hex) {
|
||||||
return r * 0.299 + g * 0.587 + b * 0.114 > 186 ? '#000000' : '#FFFFFF'
|
return r * 0.299 + g * 0.587 + b * 0.114 > 186 ? '#000000' : '#FFFFFF'
|
||||||
}
|
}
|
||||||
|
|
||||||
const clouds = {
|
const parseCalendars = () => {
|
||||||
KLUB_RESEAU: 'klub-reseau',
|
let calendars = {};
|
||||||
ELEVES_ENS: 'eleves-ens',
|
|
||||||
FRAMA_AGENDA: 'frama-agenda'
|
for (const [cloud, cals] of Object.entries(CALENDARS.sources)) {
|
||||||
|
for (const [id, attrs] of Object.entries(cals)) {
|
||||||
|
calendars[id] = { cloud: cloud, ...attrs }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return calendars;
|
||||||
}
|
}
|
||||||
|
|
||||||
const calendars = {
|
const calendars = parseCalendars()
|
||||||
'5WrcagPPARQ3BD87': {
|
|
||||||
cloud: clouds.KLUB_RESEAU,
|
|
||||||
name: 'Club réseau',
|
|
||||||
color: null,
|
|
||||||
default_location: "Cave d'hackENS"
|
|
||||||
},
|
|
||||||
TFEAKjAgNFQZpNjo: {
|
|
||||||
cloud: clouds.KLUB_RESEAU,
|
|
||||||
name: 'hackENS',
|
|
||||||
color: null,
|
|
||||||
default_location: "Cave d'hackENS"
|
|
||||||
},
|
|
||||||
LLWm8qK9iC5YGrrR: {
|
|
||||||
cloud: clouds.ELEVES_ENS,
|
|
||||||
name: 'Délégation Générale',
|
|
||||||
short_name: 'DG',
|
|
||||||
color: null
|
|
||||||
},
|
|
||||||
'2KGkWzBJGorxzyTW': {
|
|
||||||
cloud: clouds.ELEVES_ENS,
|
|
||||||
name: "La Nuit de l'ENS",
|
|
||||||
short_name: 'La Nuit',
|
|
||||||
color: null
|
|
||||||
},
|
|
||||||
w442JdS5AaQ6czrP: {
|
|
||||||
cloud: clouds.ELEVES_ENS,
|
|
||||||
name: "Écriv'ENS",
|
|
||||||
color: null
|
|
||||||
},
|
|
||||||
fRtjDkjrZyn6fxd8: {
|
|
||||||
cloud: clouds.ELEVES_ENS,
|
|
||||||
name: 'K-Fêt',
|
|
||||||
color: '#c63b52',
|
|
||||||
default_location: 'K-Fêt'
|
|
||||||
},
|
|
||||||
gsZtZK8c9EmREofn: {
|
|
||||||
cloud: clouds.ELEVES_ENS,
|
|
||||||
name: 'Ernestophone',
|
|
||||||
color: null
|
|
||||||
},
|
|
||||||
dTHrXnYgsEoSTjWB: {
|
|
||||||
cloud: clouds.ELEVES_ENS,
|
|
||||||
name: 'Évènements (COF)',
|
|
||||||
short_name: 'COF',
|
|
||||||
color: null
|
|
||||||
},
|
|
||||||
bCgRFByHLiCCNc55: {
|
|
||||||
cloud: clouds.ELEVES_ENS,
|
|
||||||
name: 'Assemblées Générales (COF)',
|
|
||||||
short_name: 'AG COF',
|
|
||||||
color: null
|
|
||||||
},
|
|
||||||
r4yJZDHjwNtH8wkR: {
|
|
||||||
cloud: clouds.ELEVES_ENS,
|
|
||||||
name: 'BdA',
|
|
||||||
color: null
|
|
||||||
},
|
|
||||||
ZtWm3MYSi388k2yk : {
|
|
||||||
cloud: clouds.ELEVES_ENS,
|
|
||||||
name: 'DDR',
|
|
||||||
color: null
|
|
||||||
},
|
|
||||||
T5WoHbs4FT5A945Z: {
|
|
||||||
cloud: clouds.FRAMA_AGENDA,
|
|
||||||
name: 'CinéClub',
|
|
||||||
color: null
|
|
||||||
},
|
|
||||||
'6SHG6cg9d7S3qqwD': {
|
|
||||||
cloud: clouds.ELEVES_ENS,
|
|
||||||
name: 'Club Inutile ☔',
|
|
||||||
color: null,
|
|
||||||
initial: false
|
|
||||||
},
|
|
||||||
Ekjb4kDqMMqwJXZF: {
|
|
||||||
cloud: clouds.ELEVES_ENS,
|
|
||||||
name: 'Rentrée des départements',
|
|
||||||
short_name: 'Dpt',
|
|
||||||
color: null
|
|
||||||
},
|
|
||||||
'8SKP62tQJP65K8EW': {
|
|
||||||
cloud: clouds.ELEVES_ENS,
|
|
||||||
name: 'Conférences de recherche',
|
|
||||||
short_name: 'Conf',
|
|
||||||
color: null
|
|
||||||
},
|
|
||||||
PnRXqeq4SsSC33FM: {
|
|
||||||
cloud: clouds.ELEVES_ENS,
|
|
||||||
name: 'Visites de bibliothèques',
|
|
||||||
short_name: 'Bibli',
|
|
||||||
initial: false,
|
|
||||||
color: null
|
|
||||||
},
|
|
||||||
NWPtiEiz62LTtjo2: {
|
|
||||||
cloud: clouds.ELEVES_ENS,
|
|
||||||
name: 'Amphis de rentrée',
|
|
||||||
short_name: 'Prés. de rentrée',
|
|
||||||
color: null
|
|
||||||
},
|
|
||||||
JiRt58aJXay9kfyk: {
|
|
||||||
cloud: clouds.ELEVES_ENS,
|
|
||||||
name: 'Réunions de rentrée des Masters',
|
|
||||||
short_name: 'Masters',
|
|
||||||
color: null
|
|
||||||
},
|
|
||||||
'5Rb4bRjCDcsFjDdQ': {
|
|
||||||
cloud: clouds.ELEVES_ENS,
|
|
||||||
name: 'Activités pour les étudiants internationaux',
|
|
||||||
short_name: 'Internationaux',
|
|
||||||
color: null
|
|
||||||
},
|
|
||||||
'62wKfQRrLNz2WXjt': {
|
|
||||||
cloud: clouds.ELEVES_ENS,
|
|
||||||
name: 'Divers',
|
|
||||||
color: null
|
|
||||||
},
|
|
||||||
TFjE83ASCMK9rfRi: {
|
|
||||||
cloud: clouds.FRAMA_AGENDA,
|
|
||||||
name: 'BandarrêtdurgENS',
|
|
||||||
short_name: 'Banda',
|
|
||||||
color: null
|
|
||||||
},
|
|
||||||
TyMrLaPPDzT7yAGC: {
|
|
||||||
cloud: clouds.ELEVES_ENS,
|
|
||||||
name: 'BDS',
|
|
||||||
color: null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const calendarsByName = Object.fromEntries(
|
const calendarsByName = Object.fromEntries(
|
||||||
Object.entries(calendars).map(([id, { name }]) => [name, id])
|
Object.entries(calendars).map(([id, { name }]) => [name, id])
|
||||||
|
@ -164,36 +44,7 @@ export const initialCalendars = Array.from(
|
||||||
.filter(cal => cal[1])
|
.filter(cal => cal[1])
|
||||||
.map(cal => cal[0])
|
.map(cal => cal[0])
|
||||||
|
|
||||||
export const calendarTree = {
|
export const calendarTree = CALENDARS.tree
|
||||||
COF: {
|
|
||||||
BdA: {},
|
|
||||||
'Évènements (COF)': {},
|
|
||||||
'Assemblées Générales (COF)': {}
|
|
||||||
},
|
|
||||||
'Clubs COF': {
|
|
||||||
'Club réseau': {},
|
|
||||||
hackENS: {},
|
|
||||||
"Écriv'ENS": {},
|
|
||||||
CinéClub: {},
|
|
||||||
Ernestophone: {},
|
|
||||||
DDR: {},
|
|
||||||
'BandarrêtdurgENS': {},
|
|
||||||
'Club Inutile ☔': {}
|
|
||||||
},
|
|
||||||
BDS: {},
|
|
||||||
"La Nuit de l'ENS": {},
|
|
||||||
'Délégation Générale': {},
|
|
||||||
'K-Fêt': {},
|
|
||||||
'Rentrée académique': {
|
|
||||||
'Amphis de rentrée': {},
|
|
||||||
'Rentrée des départements': {},
|
|
||||||
'Conférences de recherche': {},
|
|
||||||
'Visites de bibliothèques': {},
|
|
||||||
'Réunions de rentrée des Masters': {},
|
|
||||||
'Activités pour les étudiants internationaux': {}
|
|
||||||
},
|
|
||||||
Divers: {}
|
|
||||||
}
|
|
||||||
|
|
||||||
const dfs = (p, t, l) => {
|
const dfs = (p, t, l) => {
|
||||||
for (const [c, s] of Object.entries(t)) {
|
for (const [c, s] of Object.entries(t)) {
|
||||||
|
@ -266,17 +117,9 @@ class Calendar {
|
||||||
}
|
}
|
||||||
|
|
||||||
function findLocationId(location) {
|
function findLocationId(location) {
|
||||||
const adhocMap = {
|
const correctedLocation = LOCATIONS.nameMap[location] || location
|
||||||
'Amphi Jourdan': 'Amphithéâtre Jourdan',
|
|
||||||
'R2-21 (Jourdan)': 'R2-21',
|
|
||||||
'Salle Jean Ibanes (Jourdan, R1-07)': 'Salle Jean Ibanes (R1-07)',
|
|
||||||
'Salle Madeleine Rebérioux (Jourdan, R2-02)': 'Salle Madeleine Rebérioux (R2-02)',
|
|
||||||
'Salle Marcel Roncayolo (Jourdan, R2-05)': 'Salle Marcel Roncayolo (R2-05)'
|
|
||||||
}
|
|
||||||
|
|
||||||
const correctedLocation = adhocMap[location] || location
|
const result = Object.entries(LOCATIONS.rooms).find(([building, rooms]) =>
|
||||||
|
|
||||||
const result = Object.entries(STATIC_LOCATIONS).find(([building, rooms]) =>
|
|
||||||
rooms.includes(correctedLocation)
|
rooms.includes(correctedLocation)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -289,13 +132,31 @@ function fcEventFromjCalEvent(cal) {
|
||||||
return function (evt) {
|
return function (evt) {
|
||||||
const start = new Date(evt.dtstart)
|
const start = new Date(evt.dtstart)
|
||||||
const end = new Date(evt.dtend)
|
const end = new Date(evt.dtend)
|
||||||
|
|
||||||
|
const allDay = !evt.dtstart.endsWith('Z')
|
||||||
|
|
||||||
|
const duration = end - start // in ms
|
||||||
|
const dayMs = 24 * 3600 * 1000
|
||||||
|
|
||||||
const fcEvent = {
|
const fcEvent = {
|
||||||
title: `${cal.short_name ?? cal.name} : ${evt.summary}`,
|
title: `${cal.short_name ?? cal.name} : ${evt.summary}`,
|
||||||
start: evt.dtstart,
|
start: evt.dtstart,
|
||||||
end: evt.dtend,
|
end: evt.dtend,
|
||||||
color: cal.color,
|
color: cal.color,
|
||||||
textColor: invertColor(cal.color),
|
textColor: invertColor(cal.color),
|
||||||
duration: end - start // in ms
|
duration: duration
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!allDay && (duration > dayMs - 1)) {
|
||||||
|
fcEvent.allDay = true
|
||||||
|
fcEvent.simAllDay = true
|
||||||
|
|
||||||
|
fcEvent.realStart = new Date(start)
|
||||||
|
fcEvent.realEnd = new Date(end)
|
||||||
|
|
||||||
|
fcEvent.start = start.setUTCHours(0, 0, 0)
|
||||||
|
fcEvent.end = end.setUTCHours(23, 59, 59)
|
||||||
|
fcEvent.duration = end - start // Update the duration
|
||||||
}
|
}
|
||||||
|
|
||||||
fcEvent.calendar = cal.name
|
fcEvent.calendar = cal.name
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
{
|
|
||||||
"45 rue d'Ulm": [
|
|
||||||
"Amphithéâtre Galois",
|
|
||||||
"Bibliothèque Lettres",
|
|
||||||
"Salle Histoire",
|
|
||||||
"Salle Cavaillès",
|
|
||||||
"Salle Dussane",
|
|
||||||
"Salle des Actes",
|
|
||||||
"Salle des Résistants",
|
|
||||||
"Salle Cavaillès",
|
|
||||||
"Salle Cartan",
|
|
||||||
"Salle Noether",
|
|
||||||
"Salle Bourbaki",
|
|
||||||
"Cour aux Ernests",
|
|
||||||
"Cour du NIR",
|
|
||||||
"Cour Pasteur",
|
|
||||||
"Pôt",
|
|
||||||
"Petit pôt",
|
|
||||||
"Canopée",
|
|
||||||
"K-Fêt",
|
|
||||||
"Cave d'hackENS",
|
|
||||||
"Gymnase"
|
|
||||||
],
|
|
||||||
"24 rue Lhomond": ["Salle CONF IV"],
|
|
||||||
"29 rue d'Ulm": ["Bibliothèque des sciences expérimentales", "Salle Jaurès"],
|
|
||||||
"Jourdan": [
|
|
||||||
"Bibliothèque de Jourdan",
|
|
||||||
"Salle Marcel Roncayolo (R2-05)",
|
|
||||||
"Salle Madeleine Rebérioux (R2-02)",
|
|
||||||
"Amphithéâtre Jourdan",
|
|
||||||
"R2-21",
|
|
||||||
"Salle Jean Ibanes"
|
|
||||||
]
|
|
||||||
}
|
|
Loading…
Reference in a new issue