<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <title>EDT Generator</title>
    <link rel="stylesheet" href="/static/style.css">
     <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
     <meta property="og:title" content="Emploi du temps M1 Orsay" />
    <meta property="og:type" content="website" />
    <meta property="og:description" content="Outil pour concevoir un emploi du temps en pdf" />
    <meta property="og:url" content="https://edt.arcsinus.fr" />
    <meta property="og:image" content="https://edt.arcsinus.fr/static/exemple.png" />
</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 id="submit-button" type="submit">
Générer PDF
</button>


<div class="loader" style="margin: auto; display: none"></div>

<a id="pdf_link" target="_blank" style="display: none;margin-top: 2em;">Ouvrir dans une nouvelle fenêtre</a>

<div class="container">
<img src="" alt="Emploi du temps" id="img_svg" style="display: none">
</div>

</form>


<script src="/static/builder.js"></script>


<footer>Valentin Moguérou 2026 - Licence AGPL 3.0 - <a href="https://git.kaz.bzh/valentin/edt_maker_m1orsay" target="_blank">code source</a></footer>

</body>
</html>
