V7.9 — Tableau de bord et navigation regroupée pour le Service Enfance

Le Service Enfance ouvrait onze onglets à plat et atterrissait sur l'écran de
saisie, alors que son travail commence par le contrôle. Les chiffres qui
déclenchent une action vivaient sur trois écrans distincts.

- Nouvelle page dashboard.php, réservée au Service Enfance et devenue sa page
  d'atterrissage : quatre tuiles d'action, les brouillons les plus anciens avec
  ouverture directe sur la bonne semaine, les plages de couverture les plus
  déficitaires, et le suivi des quotas annuels par agent.
- Navigation regroupée par intention (Piloter / Planifier / Consulter /
  Paramétrer). Les rôles à quelques pages gardent la barre simple.
- Sous-titre propre à chaque page : le bandeau générique n'apprenait rien.
- Pastille « À valider » alimentée depuis toutes les pages, et non plus
  seulement depuis la page qu'elle annonce.

Aucune règle métier n'est modifiée : le tableau de bord relit ce que
PlanningModel, CoverageModel et QuotaModel calculent déjà, et son endpoint est
gardé par requireService(). Le droit d'accès à la page vient de la migration
V7.9 ; sans elle, l'onglet n'apparaît pas et homeUrl() se replie sur planning.

Vérifié sur la base réelle : les chiffres de quota du tableau de bord sont
identiques à ceux de api/annual_overview.php, les trois rôles rendent leurs
écrans sans erreur, le rendu JS a été exécuté dans un DOM avec la réponse réelle
de l'API, et la page ne produit aucun attribut style inline (CSP).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
PTA
2026-08-10 16:48:50 +02:00
parent 66cc8c8ade
commit b68ac15de5
17 changed files with 1571 additions and 24 deletions

View File

@@ -2553,3 +2553,270 @@ textarea:disabled {
@media print {
.annual-validation-card { display: none !important; }
}
/* ============================================================
PTA V7.9 - Navigation regroupée et tableau de bord
============================================================ */
/* --- Barre de navigation par intention --------------------- */
.view-tabs-grouped {
align-items: stretch;
gap: 0;
padding: 0.45rem 0.35rem 0.4rem;
}
.view-tab-group {
display: flex;
flex-direction: column;
gap: 0.3rem;
padding: 0 0.6rem;
}
.view-tabs-grouped .view-tab-group + .view-tab-group {
border-left: 1px solid #e2e8f0;
}
.view-tab-group-label {
padding-left: 0.35rem;
color: #7b8794;
font-size: 0.64rem;
font-weight: 800;
letter-spacing: 0.12em;
text-transform: uppercase;
white-space: nowrap;
}
.view-tab-group-items {
display: flex;
gap: 0.35rem;
}
.view-tabs-grouped .view-tab {
padding: 0.55rem 0.8rem;
font-size: 0.94rem;
}
/* Sans titres de groupe, la barre retrouve son alignement d'origine. */
.view-tabs:not(.view-tabs-grouped) .view-tab-group,
.view-tabs:not(.view-tabs-grouped) .view-tab-group-items {
display: contents;
}
.page-header-identity { min-width: 0; }
.page-header-identity .subtitle { max-width: 68ch; }
/* --- Tuiles d'action --------------------------------------- */
.dashboard-context-card .section-heading { align-items: flex-end; }
.dashboard-context-actions {
display: flex;
align-items: flex-end;
gap: 12px;
}
.dashboard-week-field { min-width: 190px; }
.dashboard-context-note {
margin: 14px 0 0;
padding: 10px 13px;
border-radius: 10px;
border-left: 5px solid #2563eb;
background: #eff6ff;
color: #1e3a5f;
font-size: 0.9rem;
}
.dashboard-tiles {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
gap: 16px;
margin-bottom: 20px;
}
.dashboard-tile {
display: grid;
gap: 5px;
padding: 18px 20px;
border: 1px solid #e4e8eb;
border-left: 6px solid #cbd5e1;
border-radius: 16px;
background: #fff;
box-shadow: 0 6px 24px rgba(23, 32, 42, 0.05);
color: inherit;
text-decoration: none;
transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.dashboard-tile:hover,
.dashboard-tile:focus-visible {
transform: translateY(-2px);
box-shadow: 0 12px 28px rgba(23, 32, 42, 0.11);
}
.dashboard-tile-label {
color: #5f6b7a;
font-size: 0.78rem;
font-weight: 800;
letter-spacing: 0.06em;
text-transform: uppercase;
}
.dashboard-tile-value { font-size: 2.1rem; line-height: 1.1; }
.dashboard-tile-detail { color: #66737d; font-size: 0.84rem; }
.dashboard-tile-cta {
margin-top: 6px;
color: #1f4c73;
font-size: 0.82rem;
font-weight: 800;
}
.dashboard-tile-cta::after { content: ' →'; }
.dashboard-tile.is-alert { border-left-color: #c72f3f; }
.dashboard-tile.is-alert .dashboard-tile-value { color: #a3212f; }
.dashboard-tile.is-clear { border-left-color: #2f855a; }
.dashboard-tile.is-clear .dashboard-tile-value { color: #256d3b; }
/* --- Listes « à traiter » ---------------------------------- */
.dashboard-columns {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
gap: 20px;
}
.dashboard-columns > .card { margin-bottom: 0; }
.dashboard-list-card { display: flex; flex-direction: column; }
.dashboard-list {
display: grid;
gap: 9px;
margin: 0;
padding: 0;
list-style: none;
}
.dashboard-list-item {
display: flex;
align-items: center;
gap: 14px;
padding: 11px 13px;
border: 1px solid #e6ebee;
border-radius: 11px;
background: #f9fbfc;
}
.dashboard-list-main { flex: 1 1 auto; min-width: 0; }
.dashboard-list-main strong { display: block; }
.dashboard-list-main small { color: #66737d; font-size: 0.82rem; }
.dashboard-list-meta {
display: grid;
gap: 2px;
text-align: right;
white-space: nowrap;
}
.dashboard-list-meta span { color: #66737d; font-size: 0.78rem; }
.dashboard-list-action {
display: inline-flex;
flex: 0 0 auto;
align-items: center;
min-height: 38px;
padding: 8px 14px;
font-size: 0.86rem;
text-decoration: none;
}
.dashboard-gap-count { color: #a3212f; }
.dashboard-inline-note {
margin-top: 14px;
padding: 11px 13px;
border-radius: 10px;
border-left: 5px solid #d97706;
background: #fffbeb;
color: #7d5c00;
font-size: 0.86rem;
}
/* --- Suivi des quotas -------------------------------------- */
.dashboard-quota-summary {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
gap: 12px;
margin-bottom: 18px;
}
.dashboard-quota-table-wrap { overflow-x: auto; }
.dashboard-quota-table {
width: 100%;
border-collapse: collapse;
font-size: 0.9rem;
}
.dashboard-quota-table th,
.dashboard-quota-table td {
padding: 10px 12px;
border-bottom: 1px solid #eceff1;
text-align: left;
vertical-align: middle;
}
.dashboard-quota-table th {
color: #5f6b7a;
font-size: 0.76rem;
letter-spacing: 0.05em;
text-transform: uppercase;
}
.dashboard-quota-table td small { display: block; color: #66737d; font-size: 0.78rem; }
.dashboard-quota-table tr.is-over-quota { background: #fef4f4; }
.dashboard-quota-action-cell { text-align: right; }
.dashboard-quota-action-cell .button {
display: inline-flex;
align-items: center;
min-height: 36px;
padding: 7px 13px;
font-size: 0.84rem;
text-decoration: none;
}
.dashboard-quota-gauge-cell {
display: flex;
align-items: center;
gap: 10px;
white-space: nowrap;
}
/* Jauge native : la CSP interdit l'attribut style, la largeur ne peut donc pas
être calculée en JavaScript sur une simple div. */
.dashboard-quota-gauge {
width: 110px;
height: 9px;
border: 0;
border-radius: 999px;
background: #e4e9ec;
appearance: none;
}
.dashboard-quota-gauge::-webkit-progress-bar { background: #e4e9ec; border-radius: 999px; }
.dashboard-quota-gauge::-webkit-progress-value { background: #2f6f9f; border-radius: 999px; }
.dashboard-quota-gauge::-moz-progress-bar { background: #2f6f9f; border-radius: 999px; }
.dashboard-quota-gauge.is-over::-webkit-progress-value { background: #c72f3f; }
.dashboard-quota-gauge.is-over::-moz-progress-bar { background: #c72f3f; }
/* --- Raccourcis -------------------------------------------- */
.dashboard-shortcuts {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
gap: 12px;
}
.dashboard-shortcut {
display: grid;
gap: 3px;
padding: 14px 16px;
border: 1px solid #e4e8eb;
border-radius: 12px;
background: #f9fbfc;
color: inherit;
text-decoration: none;
}
.dashboard-shortcut:hover,
.dashboard-shortcut:focus-visible { border-color: #b9c6cf; background: #fff; }
.dashboard-shortcut small { color: #66737d; font-size: 0.82rem; }
@media (max-width: 900px) {
.view-tabs-grouped { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
.view-tabs-grouped .view-tab-group + .view-tab-group { border-left: 0; }
.view-tab-group { width: 100%; padding: 0; }
.view-tab-group-items { flex-wrap: wrap; }
.dashboard-context-card .section-heading { align-items: stretch; }
.dashboard-context-actions { flex-wrap: wrap; }
}
@media (max-width: 620px) {
.dashboard-list-item { flex-wrap: wrap; }
.dashboard-list-meta { text-align: left; }
.dashboard-list-action { width: 100%; justify-content: center; }
}