Initial commit

This commit is contained in:
2026-08-05 07:34:40 +02:00
parent 39a19834e2
commit 15d3087fe4
7 changed files with 1269 additions and 0 deletions
+112
View File
@@ -0,0 +1,112 @@
#import "@preview/cetz:0.5.1"
#let time(h,m) = datetime(hour:h, minute: m, second: 0)
#let parse_time(s) = {
let (h, m) = s.match(regex("(\d{2}):(\d{2})")).captures.map(int)
time(h,m)
}
#let gety(s) = {
let dt = parse_time(s)
11-(dt - time(8,0)).hours()
}
#let sans_font = "Fira Sans"
#let titre = "EDT 2026/2027 -- M1 S1"
#let data = json(bytes(sys.inputs.data))
#let cours = data.cours
/*
Un exemple :
#let cours = (
(day: 0, start: "08:15", end: "10:15", name:"Algèbre (CM)", prof:"Jean-Benoît Bost", room: "OA1", color: "#ff80b3"),
(day: 0, start: "10:30", end: "13:00", name:"Algèbre (TD)", prof:"x", room: "OA1", color: "#ff80b3"),
(day: 3, start: "14:00", end: "16:00", name:"Algèbre (CM)", prof:"Jean-Benoît Bost", room: "OA1", color: "#ff80b3"),
(day: 3, start: "16:15", end: "18:45", name:"Algèbre (TD)", prof:"x", room: "OA1", color: "#ff80b3"),
(day: 0, start: "14:00", end: "16:00", name:"Analyse (CM)", prof:"Blanche Buet", room: "OA1", color: "#80ffcc"),
(day: 0, start: "16:15", end: "18:45", name:"Analyse (TD)", prof:"x", room: "OA1", color: "#80ffcc"),
(day: 2, start: "08:15", end: "10:15", name:"Analyse (CM)", prof:"Blanche Buet", room: "OA1", color: "#80ffcc"),
(day: 2, start: "10:30", end: "13:00", name:"Analyse (TD)", prof:"x", room: "OA1", color: "#80ffcc"),
(day: 1, start: "14:00", end: "16:00", name:"Cryptographie (CM)", prof:"Stéphane Fischler", room: "OA1", color: "#e6b3ff"),
(day: 4, start: "10:30", end: "12:30", name:"Cryptographie (TP)", prof:"Chimène Fischler", room: "OA1", color: "#e6b3ff")
)
*/
#set page(
paper: "a4",
flipped: true,
footer: [
#set align(right)
#set text(font: sans_font, size: 9pt)
$copyright$ EDT Valentin Moguérou 2026
],
margin: (
x: 1.5cm,
top: 1cm,
bottom: 1cm,
)
)
#set par(justify: true)
#set text(
font: "New Computer Modern",
size: 11pt,
)
#set align(center)
#let jours = ("Lundi","Mardi","Mercredi","Jeudi","Vendredi")
#align(center, text(titre, size: 15pt, weight: "bold"))
#cetz.canvas(
length: 1.5cm,
{
import cetz.draw: *
for heure in range(8,20) {
content((-.5,18.85-heure),
text([#heure:00], font: sans_font, size: 9pt))
line((-0.5,19-heure),(0,19-heure), stroke:1pt)
if calc.even(heure) { line((0,19-heure),(15,19-heure), stroke:0.5pt+gray) }
}
line((0,11),(15,11), stroke:1pt) // 8h
line((0,0),(15,0), stroke:1pt) // 19h
for c in cours {
content(
(3*c.day, gety(c.start)+.05),
(3*(c.day+1), gety(c.end)-.05),
frame: "rect",
fill: rgb(c.color),
stroke: 0.5pt,
align(center+horizon)[
*#c.name* \
#c.prof
#set text(size: 9pt, font: sans_font)
#if c.room != "" [*#c.room*, ]
#(c.start)--#c.end
]
)
}
for jour in range(5) {
content((3*jour+1.5,11.3), text([#jours.at(jour)], font: sans_font, size: 11pt))
line((3*jour,11.3),(3*jour,0), stroke:1pt)
}
line((15,11.5),(15,0), stroke:1pt)
})
+244
View File
@@ -0,0 +1,244 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>EDT Generator</title>
<link rel="stylesheet" href="/static/style.css">
</head>
<body>
<h1>#m1edt</h1>
<form id="courseForm">
<h2>Cours fondamentaux : choisir 2 parmi 3</h2>
<table>
<thead>
<tr>
<th></th>
<th>UE</th>
<th>Sélection</th>
<th>Jour</th>
<th>Début</th>
<th>Fin</th>
<th>Atome</th>
<th>Enseignant</th>
<th>Salle</th>
</tr>
</thead>
<tbody id="courses-base">
{% set jours = ["Lundi","Mardi","Mercredi","Jeudi","Vendredi"] %}
{% for ue in cours_base %}
{% set rowspan = ue.cm|length + 2 * (ue.td|length) %}
{# ---------------- CM ---------------- #}
{% for cm in ue.cm %}
<tr
data-ue="{{ ue.ue }}"
data-name="{{ ue.name }} CM"
data-prof="{{ cm.prof }}"
data-room="{{ cm.room }}"
data-color="{{ ue.color }}"
data-day="{{ cm.day }}"
data-start="{{ cm.start }}"
data-end="{{ cm.end }}"
checkbox-id="checkbox-{{ ue.ue }}-cm">
{% if loop.first %}
<td rowspan="{{ rowspan }}" bgcolor="{{ ue.color }}"></td>
<td rowspan="{{ rowspan }}">{{ ue.name }}</td>
<td rowspan="{{ ue.cm|length }}">
<input
id="checkbox-{{ ue.ue }}-cm"
class="ue-selector"
data-ue="{{ ue.ue }}"
type="checkbox">
</td>
{% endif %}
<td>{{ jours[cm.day] }}</td>
<td>{{ cm.start }}</td>
<td>{{ cm.end }}</td>
{% if loop.first %}
<td rowspan="{{ ue.cm|length }}">CM</td>
<td rowspan="{{ ue.cm|length }}">{{ cm.prof }}</td>
{% endif %}
<td>{{ cm.room }}</td>
</tr>
{% endfor %}
{# ---------------- TD ---------------- #}
{% for td in ue.td %}
{% for slot in td.slots %}
<tr
data-ue="{{ ue.ue }}"
data-name="{{ ue.name }} TD"
data-prof="{{ td.prof }}"
data-room="{{ slot.room }}"
data-color="{{ ue.color }}"
data-day="{{ slot.day }}"
data-start="{{ slot.start }}"
data-end="{{ slot.end }}"
checkbox-id="checkbox-{{ ue.ue }}-td{{ td.group }}">
{% if loop.first %}
<td rowspan="{{ td.slots|length }}">
<input
id="checkbox-{{ ue.ue }}-td{{ td.group }}"
type="radio"
name="gr_td_{{ ue.ue }}"
data-ue="{{ ue.ue }}"
disabled>
</td>
{% endif %}
<td>{{ jours[slot.day] }}</td>
<td>{{ slot.start }}</td>
<td>{{ slot.end }}</td>
{% if loop.first %}
<td rowspan="{{ td.slots|length }}">TD G{{ td.group }}</td>
<td rowspan="{{ td.slots|length }}">{{ td.prof }}</td>
{% endif %}
<td>{{ slot.room }}</td>
</tr>
{% endfor %}
{% endfor %}
{% endfor %}
</tbody>
</table>
<h2>Autres cours</h2>
<table>
<thead>
<tr>
<th></th>
<th>UE</th>
<th>Sélection</th>
<th>Jour</th>
<th>Début</th>
<th>Fin</th>
<th>Atome</th>
<th>Enseignant</th>
<th>Salle</th>
</tr>
</thead>
<tbody id="courses-autre">
{% set jours = ["Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi"] %}
{% for ue in cours_autres %}
{% set rowspan = ue.atoms|length %}
{% for atom in ue.atoms %}
<tr
data-ue="{{ ue.ue }}"
data-name="{{ ue.name }}"
data-prof="{{ atom.prof }}"
data-room="{{ atom.room }}"
data-color="{{ ue.color }}"
data-day="{{ atom.day }}"
data-start="{{ atom.start }}"
data-end="{{ atom.end }}"
checkbox-id="checkbox-{{ ue.ue }}">
{% if loop.first %}
<td rowspan="{{ rowspan }}" bgcolor="{{ ue.color }}"></td>
<td rowspan="{{ rowspan }}">{{ ue.name }}</td>
<td rowspan="{{ rowspan }}">
<input
id="checkbox-{{ ue.ue }}"
class="ue-selector"
data-ue="{{ ue.ue }}"
type="checkbox">
</td>
{% endif %}
<td>{{ jours[atom.day] }}</td>
<td>{{ atom.start }}</td>
<td>{{ atom.end }}</td>
<td>{{ atom.label }}</td>
<td>{{ atom.prof }}</td>
<td>{{ atom.room }}</td>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</table>
<h2>Ajouter des cours</h2>
<table>
<thead>
<tr>
<th>
<input id="select-all"
type="checkbox">
</th>
<th>Jour</th>
<th>Début</th>
<th>Fin</th>
<th>Nom</th>
<th>Enseignant</th>
<th>Salle</th>
<th>Couleur</th>
<th></th>
</tr>
</thead>
<tbody id="courses"></tbody>
</table>
<button type="button" onclick="addCourse()">
Ajouter
</button>
<br>
<button type="submit">
Générer PDF
</button>
</form>
<script src="/static/builder.js"></script>
</body>
</html>