Template cleanup

This commit is contained in:
theo@manjaro 2024-02-12 16:09:28 +01:00
parent c5e0582f21
commit b4e1a0b9a4

View File

@ -8,148 +8,38 @@
</head> </head>
<body> <body>
<main> <main>
<div class="flex"> <h1><b>{{ depts_str }}</b></h1>
<p> <p>Salles disponibles:</p>
DEMO!!!!!Départements sélectionnés : <br> {% if date_str != "" : %}
<b>{{ depts_str }}</b> <p>Le {{ date_str }}</p>
</p> {% endif %}
</div> <div class="slide-track">
<div class="flex"> {% if favs: %}
{% if date_str != "" : %} <!-- Afficher les favoris -->
<b>Le {{ date_str }}</b> {% if favs_free_rooms|length>0: %}
{% endif %} {% for room in favs_free_rooms : %}
</div> <div class="room-row">
<div class="flex" style="margin: 10px"> {{ room.name }} {% if DEBUG :%}( {{ room.id }} ){% endif %}
<a class="button" href='/app/date-select{{ change_date_str }}'>Choisir une date</a> {% if not(room.noend) : %}
</div> <p class=details>Jusqu'à {{ frooms_disp[room.name]["end"] }} (dans {{ frooms_disp[room.name]["rtime"] }})</p>
{% if favs: %} {% endif %}
<div class="flex" style="margin: 10px"> </div>
<a class="button" href="{{ nofavslink }}">Retirer les favoris</a> {% endfor %}
</div> {% endif %}
{% endif %} {% else %}
<form action="/app/free-rooms" method="get"> <!-- Si les favoris ne sont pas définis, afficher les salles classiques -->
<div class="flex" style="margin: 10px"> {% if free_rooms|length>0 %}
<input style="font-size: 16px;" type="submit" value="Enregistrer les favoris"> {% for room in free_rooms: %}
</div> <div class="room-row">
{% if favs: %} {{ room.name }} {% if DEBUG :%}( {{ room.id }} ){% endif %}
<div class="flex-pc"> {% if not room.noend : %}
{% if favs_free_rooms|length>0: %} <p class=details>Jusqu'à {{ frooms_disp[room.name]["end"] }} (dans {{ frooms_disp[room.name]["rtime"] }})</p>
<div class="room-column"> {% endif %}
<br> </div>
<h1>Favoris disponibles maintenant</h1> {% endfor %}
<div class="flex-container"> {% endif %}
<ul>
{% for room in favs_free_rooms : %}
<dt>
<div class="room-row">
<div>
{{ room.name }} {% if DEBUG :%}( {{ room.id }} ){% endif %}
{% if not(room.noend) : %}
<p class=details>Jusqu'à {{ frooms_disp[room.name]["end"] }} (dans {{ frooms_disp[room.name]["rtime"] }})</p>
{% endif %}
</div>
<div>
<input class="fav" type="checkbox" id="{{ room.id }}" name="favs" value="{{ room.id }}" checked> <label style="width:30px;height:30px" for="{{ room.id }}"></label>
</div>
</div>
</dt>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
{% if favs_soon_rooms|length>0: %}
<div class="room-column">
<br>
<h1>Favoris disponibles prochainement</h1>
<div class="flex-container">
<ul>
{% for room in favs_soon_rooms: %}
<dt>
<div class="room-row">
<div>
{{ room.name }} {% if DEBUG :%}( {{ room.id }} ){% endif %}
{% if room.noend : %}
<p class=details>À {{ frooms_disp[room.name]["start"] }} (dans {{ frooms_disp[room.name]["rtime"] }})</p>
{% else %}
<p class=details>De {{ frooms_disp[room.name]["start"] }} à {{ frooms_disp[room.name]["end"] }} (dans {{ frooms_disp[room.name]["rtime"] }})</p>
{% endif %}
</div>
<div>
<input class="fav" type="checkbox" id="{{ room.id }}" name="favs" value="{{ room.id }}" checked> <label style="width:30px;height:30px" for="{{ room.id }}"></label>
</div>
</div>
</dt>
{% endfor %}
</ul>
</div>
</div>
{% endif %} {% endif %}
</div> </div>
{% endif %}
<div class="flex-pc">
{% if free_rooms|length>0 %}
<div class="room-column">
<br>
<h1>Disponibles maintenant</h1>
<div class="flex-container">
<ul>
{% for room in free_rooms: %}
<dt>
<div class="room-row">
<div>
{{ room.name }} {% if DEBUG :%}( {{ room.id }} ){% endif %}
{% if not room.noend : %}
<p class=details>Jusqu'à {{ frooms_disp[room.name]["end"] }} (dans {{ frooms_disp[room.name]["rtime"] }})</p>
{% endif %}
</div>
<div>
<input class="fav" type="checkbox" id="{{ room.id }}" name="favs" value="{{ room.id }}"> <label style="width:30px;height:30px" for="{{ room.id }}"></label>
</div>
</div>
</dt>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
{% if soon_rooms|length>0 %}
<div class="room-column">
<br>
<h1>Disponibles prochainement</h1>
<div class="flex-container">
<ul>
{% for room in soon_rooms: %}
<dt>
<div class="room-row">
<div>
{{ room.name }} {% if DEBUG :%}( {{ room.id }} ){% endif %}
{% if room.noend : %}
<p class=details>À {{ frooms_disp[room.name]["start"] }} (dans {{ frooms_disp[room.name]["rtime"] }})</p>
{% else %}
<p class=details>De {{ frooms_disp[room.name]["start"] }} à {{ frooms_disp[room.name]["end"] }} (dans {{ frooms_disp[room.name]["rtime"] }})</p>
{% endif %}
</div>
<div>
<input class="fav" type="checkbox" id="{{ room.id }}" name="favs" value="{{ room.id }}"> <label style="width:30px;height:30px" for="{{ room.id }}"></label>
</div>
</div>
</dt>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
</div>
<div class="flex">
<!-- Magie noire pour conserver les départements et date-heure séléctionnés (FIXME !!!!) -->
{% for d in dident_list : %}
<span style="display: none;"><input type="text" name="dept" value="{{ d }}"/></span>
{% endfor %}
<span style="display: none;"><input type="text" name="date" value="{{ date_uf_sav }}"/></span>
<span style="display: none;"><input type="text" name="time" value="{{ time_uf_sav }}"/></span>
</div>
</form>
</main> </main>
</body> </body>
</html> </html>