Spaces:
Running
Running
Commit ·
df82a12
1
Parent(s): c3430b7
Refactor HTML structure in admin and base templates for improved readability and organization
Browse files- templates/admin.html +132 -1
- templates/base.html +24 -1
templates/admin.html
CHANGED
|
@@ -1 +1,132 @@
|
|
| 1 |
-
{% extends 'base.html' %}{% block content %}<section class="admin-heading">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends 'base.html' %}{% block content %}<section class="admin-heading">
|
| 2 |
+
<div>
|
| 3 |
+
<div class="section-tag">TABLEAU DE BORD</div>
|
| 4 |
+
<h1>Organisation <em>de la soirée.</em></h1>
|
| 5 |
+
<p class="sub">Gère les invitations et choisis la meilleure date en un coup d'œil.</p>
|
| 6 |
+
</div><button class="quiet" id="logout">Déconnexion ↗</button>
|
| 7 |
+
</section>
|
| 8 |
+
<div class="metrics" id="metrics"></div>
|
| 9 |
+
<div class="tabs"><button class="tab active" data-tab="invites">Invités & services</button><button class="tab"
|
| 10 |
+
data-tab="dates">Dates & sondage</button><button class="tab" data-tab="courses">Liste des courses</button></div>
|
| 11 |
+
<section id="invites" class="tab-content">
|
| 12 |
+
<div class="panel">
|
| 13 |
+
<div class="panel-heading">
|
| 14 |
+
<div>
|
| 15 |
+
<div class="section-tag">LISTE DES PARTICIPANTS</div>
|
| 16 |
+
<h2>Mes invités</h2>
|
| 17 |
+
</div><a class="outline" href="/api/admin/export.csv">↓ Export CSV / Excel</a>
|
| 18 |
+
</div>
|
| 19 |
+
<div class="toolbar"><input id="search" placeholder="Rechercher un nom ou un service…"><select id="filter">
|
| 20 |
+
<option value="">Tous les statuts</option>
|
| 21 |
+
<option>À inviter</option>
|
| 22 |
+
<option>En attente</option>
|
| 23 |
+
<option>Confirmé</option>
|
| 24 |
+
<option>Absent</option>
|
| 25 |
+
</select></div>
|
| 26 |
+
<div class="table-scroll">
|
| 27 |
+
<table>
|
| 28 |
+
<thead>
|
| 29 |
+
<tr>
|
| 30 |
+
<th>Nom</th>
|
| 31 |
+
<th>Service</th>
|
| 32 |
+
<th>Réponse</th>
|
| 33 |
+
<th>Personnes au total</th>
|
| 34 |
+
<th>Contribution</th>
|
| 35 |
+
<th>Allergies / intolérances</th>
|
| 36 |
+
<th>Actions</th>
|
| 37 |
+
</tr>
|
| 38 |
+
</thead>
|
| 39 |
+
<tbody id="guest-table"></tbody>
|
| 40 |
+
</table>
|
| 41 |
+
</div>
|
| 42 |
+
<div class="divider"></div>
|
| 43 |
+
<h3 id="edit-title">Ajouter un invité</h3>
|
| 44 |
+
<form id="guest-form"><input name="id" type="hidden">
|
| 45 |
+
<div class="form-grid"><label>Nom<input name="name" required maxlength="120"
|
| 46 |
+
placeholder="Prénom Nom"></label><label>Service<input name="service" list="services" required
|
| 47 |
+
maxlength="60" placeholder="ORGA"><datalist id="services">
|
| 48 |
+
<option>ORGA</option>
|
| 49 |
+
<option>DT</option>
|
| 50 |
+
<option>EMRG</option>
|
| 51 |
+
<option>Autre</option>
|
| 52 |
+
</datalist></label><label>Statut<select name="status">
|
| 53 |
+
<option>À inviter</option>
|
| 54 |
+
<option selected>En attente</option>
|
| 55 |
+
<option>Confirmé</option>
|
| 56 |
+
<option>Absent</option>
|
| 57 |
+
</select></label><label>Nombre total (invité compris)<input name="participants" type="number"
|
| 58 |
+
min="1" max="20" value="1" required></label><label>Contribution<input name="contribution"
|
| 59 |
+
maxlength="250" placeholder="Boissons, dessert…"></label><label>Allergies /
|
| 60 |
+
intolérances<textarea name="dietary" maxlength="500" rows="2"
|
| 61 |
+
placeholder="Sans gluten, allergie aux fruits à coque…"></textarea></label><label>Notes<input
|
| 62 |
+
name="notes" maxlength="500" placeholder="Allergie, informations…"></label></div>
|
| 63 |
+
<div class="actions"><button class="primary" id="save-guest">Enregistrer l'invité</button><button
|
| 64 |
+
class="quiet" type="button" id="reset-form">Annuler</button></div>
|
| 65 |
+
<p class="message" id="guest-msg"></p>
|
| 66 |
+
</form>
|
| 67 |
+
</div>
|
| 68 |
+
</section>
|
| 69 |
+
<section id="dates" class="tab-content hidden">
|
| 70 |
+
<div class="panel">
|
| 71 |
+
<div class="section-tag">DATES PROPOSÉES</div>
|
| 72 |
+
<h2>Choisir le bon soir</h2>
|
| 73 |
+
<p class="sub">Les changements de dates sont immédiatement visibles dans le sondage public.</p>
|
| 74 |
+
<div id="date-admin-list"></div>
|
| 75 |
+
<form id="date-form" class="date-form"><label>Ajouter une date<input name="day" type="date"
|
| 76 |
+
required></label><label>Heure de début<input name="time" type="time" value="19:00"
|
| 77 |
+
required></label><button class="primary">Ajouter</button></form>
|
| 78 |
+
<p id="date-msg" class="message"></p>
|
| 79 |
+
</div>
|
| 80 |
+
<div class="panel space-top">
|
| 81 |
+
<div class="section-tag">MATRICE DES DISPONIBILITÉS</div>
|
| 82 |
+
<h2>Résultats détaillés</h2>
|
| 83 |
+
<div class="table-scroll">
|
| 84 |
+
<table id="matrix"></table>
|
| 85 |
+
</div>
|
| 86 |
+
</div>
|
| 87 |
+
</section>
|
| 88 |
+
<section id="courses" class="tab-content hidden">
|
| 89 |
+
<div class="panel">
|
| 90 |
+
<div class="panel-heading">
|
| 91 |
+
<div>
|
| 92 |
+
<div class="section-tag">PRÉPARATION DU BUFFET</div>
|
| 93 |
+
<h2>Liste des courses</h2>
|
| 94 |
+
<p class="sub">Ajoute des articles, précise leurs quantités et coche ceux qui sont achetés. Cet espace
|
| 95 |
+
est réservé à l’organisateur.</p>
|
| 96 |
+
</div><a class="outline" href="/api/admin/shopping.csv">↓ Export CSV / Excel</a>
|
| 97 |
+
</div>
|
| 98 |
+
<div class="metrics shopping-metrics" id="shopping-metrics"></div>
|
| 99 |
+
<form id="shopping-form" class="shopping-form"><input type="hidden" name="id">
|
| 100 |
+
<div class="form-grid"><label>Article<input name="label" maxlength="160" placeholder="Ex. Tomates cerises"
|
| 101 |
+
required></label><label>Quantité<input name="quantity" maxlength="80"
|
| 102 |
+
placeholder="Ex. 750 g"></label><label>Catégorie<select name="category">
|
| 103 |
+
<option>Apéritif salé</option>
|
| 104 |
+
<option>Dessert</option>
|
| 105 |
+
<option>Boissons</option>
|
| 106 |
+
<option>Frais</option>
|
| 107 |
+
<option>Épicerie</option>
|
| 108 |
+
<option>Matériel</option>
|
| 109 |
+
<option>Autre</option>
|
| 110 |
+
</select></label></div>
|
| 111 |
+
<div class="actions"><button class="primary" id="shopping-submit" type="submit">Ajouter à la
|
| 112 |
+
liste</button><button class="quiet" id="shopping-reset" type="button">Annuler</button></div>
|
| 113 |
+
<p class="message" id="shopping-msg" role="status"></p>
|
| 114 |
+
</form>
|
| 115 |
+
<div class="divider"></div>
|
| 116 |
+
<div class="table-scroll">
|
| 117 |
+
<table>
|
| 118 |
+
<thead>
|
| 119 |
+
<tr>
|
| 120 |
+
<th>Acheté</th>
|
| 121 |
+
<th>Article</th>
|
| 122 |
+
<th>Quantité</th>
|
| 123 |
+
<th>Catégorie</th>
|
| 124 |
+
<th>Actions</th>
|
| 125 |
+
</tr>
|
| 126 |
+
</thead>
|
| 127 |
+
<tbody id="shopping-table"></tbody>
|
| 128 |
+
</table>
|
| 129 |
+
</div>
|
| 130 |
+
</div>
|
| 131 |
+
</section>{% endblock %}{% block scripts %}
|
| 132 |
+
<script src="{{url_for('static',filename='admin.js')}}"></script>{% endblock %}
|
templates/base.html
CHANGED
|
@@ -1 +1,24 @@
|
|
| 1 |
-
<!DOCTYPE html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="fr">
|
| 3 |
+
|
| 4 |
+
<head>
|
| 5 |
+
<meta charset="utf-8">
|
| 6 |
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
| 7 |
+
<meta name="csrf-token" content="{{ csrf_token() }}">
|
| 8 |
+
<title>Soirée entre collègues</title>
|
| 9 |
+
<link rel="stylesheet" href="{{url_for('static',filename='style.css')}}">
|
| 10 |
+
</head>
|
| 11 |
+
|
| 12 |
+
<body>
|
| 13 |
+
<header class="site-header">
|
| 14 |
+
<div class="shell head"><a class="brand" href="/">✦ <span>La soirée <small>entre collègues</small></span></a>
|
| 15 |
+
<nav><a href="/">Sondage</a><a href="/admin">Organisation</a></nav>
|
| 16 |
+
</div>
|
| 17 |
+
</header>
|
| 18 |
+
<main class="shell">{% block content %}{% endblock %}</main>
|
| 19 |
+
<footer class="shell foot">Apéritif dînatoire du Capitaine Maréchal</footer>
|
| 20 |
+
<script>window.csrf = document.querySelector('meta[name="csrf-token"]').content; async function api(url, opt = {}) { const r = await fetch(url, { ...opt, headers: { 'Content-Type': 'application/json', 'X-CSRF-Token': window.csrf, ...(opt.headers || {}) } }); let j = await r.json().catch(() => ({})); if (!r.ok) throw Error(j.error || `Erreur ${r.status}`); return j; } function escapeHtml(s) { return String(s ?? '').replace(/[&<>"']/g, c => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c])); } function formatDay(d) { return new Date(d + 'T12:00:00').toLocaleDateString('fr-FR', { weekday: 'long', day: 'numeric', month: 'long' }); }</script>
|
| 21 |
+
{% block scripts %}{% endblock %}
|
| 22 |
+
</body>
|
| 23 |
+
|
| 24 |
+
</html>
|