diff --git a/css/style.css b/css/style.css index 18eda35..adb23df 100644 --- a/css/style.css +++ b/css/style.css @@ -1093,6 +1093,7 @@ ul.ms1-menu-compte li a:hover, ul.ms1-menu-compte li a:active { } #module-bib .bib-tool-btn{ + position:relative; display:flex; align-items:stretch; width:100%; @@ -1108,9 +1109,32 @@ ul.ms1-menu-compte li a:hover, ul.ms1-menu-compte li a:active { text-align:left; cursor:pointer; user-select:none; + overflow:hidden; transition:background .15s ease, border-color .15s ease, box-shadow .15s ease; } +/* MSIN-4440 — Liseré haut des tuiles (relief, cohérent avec le panneau détail). */ +#module-bib .bib-tool-btn::before{ + content:''; + position:absolute; + top:0; + left:0; + right:0; + height:3px; + background:rgba(255,255,255,.38); + pointer-events:none; +} + +#module-bib .bib-tool-btn:hover::before, +#module-bib .bib-tool-btn:focus::before{ + background:rgba(255,255,255,.5); +} + +#module-bib .bib-tool-btn.is-active::before{ + height:4px; + background:rgba(255,255,255,.72); +} + #module-bib .bib-tool-btn:hover, #module-bib .bib-tool-btn:focus{ background:#2852b8; @@ -1130,6 +1154,16 @@ ul.ms1-menu-compte li a:hover, ul.ms1-menu-compte li a:active { font-weight:600; } +#module-bib .bib-tool-btn--alt::before{ + background:rgba(47,95,208,.28); +} + +#module-bib .bib-tool-btn--alt:hover::before, +#module-bib .bib-tool-btn--alt:focus::before, +#module-bib .bib-tool-btn--alt.is-active::before{ + background:#2f5fd0; +} + #module-bib .bib-tool-btn--alt:hover, #module-bib .bib-tool-btn--alt:focus{ background:#e8f0f8; @@ -1243,6 +1277,7 @@ ul.ms1-menu-compte li a:hover, ul.ms1-menu-compte li a:active { } #module-bib .bib-tool-detail{ + position:relative; margin-top:8px; border:1px solid #c8d6e5; border-radius:8px; @@ -1252,15 +1287,37 @@ ul.ms1-menu-compte li a:hover, ul.ms1-menu-compte li a:active { } #module-bib .bib-tool-detail__header{ + position:relative; + display:flex; + align-items:center; + justify-content:space-between; + gap:10px; padding:8px 12px; font-size:14px; border-bottom:1px solid rgba(255,255,255,.15); } +#module-bib .bib-tool-detail__header::before{ + content:''; + position:absolute; + top:0; + left:0; + right:0; + height:3px; + background:rgba(255,255,255,.42); + pointer-events:none; +} + #module-bib .bib-tool-detail__title{ + flex:1 1 auto; + min-width:0; font-weight:700; } +#module-bib .bib-tool-detail__close{ + flex-shrink:0; +} + #module-bib .bib-tool-detail__body{ background:#f4f8fc; } diff --git a/js/v2/bib-assignments.js b/js/v2/bib-assignments.js index 7c5a0e2..de3e976 100644 --- a/js/v2/bib-assignments.js +++ b/js/v2/bib-assignments.js @@ -471,23 +471,55 @@ } if (toolId === 'qty_summary') { - var qtyBadges = panel.querySelector('.bib-qty-summary-badges'); - if (qtyBadges) { - dest.innerHTML = qtyBadges.outerHTML; - } + dest.innerHTML = ''; return; } if (toolId === 'anomalies') { var anomCount = panel.querySelector('.bib-anomalies-count'); + var destBadge = dest.querySelector('[data-bib-anomalies-nav-badge]'); + var strTodo = bibJs('jsAnomaliesNavTodo') || 'Élément à valider'; + var intCount = 0; + var blnPending = true; + if (anomCount) { - dest.innerHTML = anomCount.outerHTML; + blnPending = anomCount.getAttribute('aria-busy') === 'true'; + if (!blnPending) { + intCount = parseInt(String(anomCount.textContent || '').trim(), 10); + if (isNaN(intCount)) { + intCount = 0; + } + } + } + + if (!destBadge) { + dest.innerHTML = ''; + if (!blnPending && intCount > 0) { + dest.innerHTML = '' + + strTodo + + ''; + } + return; + } + + if (blnPending || intCount <= 0) { + destBadge.classList.add('bib-ui-hidden'); + destBadge.setAttribute('aria-hidden', 'true'); + destBadge.textContent = ''; + } else { + destBadge.classList.remove('bib-ui-hidden'); + destBadge.removeAttribute('aria-hidden'); + destBadge.textContent = strTodo; + destBadge.setAttribute('title', strTodo); } } } function bibSyncAllToolNavBadges() { - ['event_config', 'qty_summary', 'anomalies'].forEach(bibSyncToolNavBadges); + bibSyncToolNavBadges('event_config'); + bibSyncToolNavBadges('anomalies'); } function bibEnsureToolLoaded(toolId) { @@ -915,6 +947,12 @@ }); moduleBib.addEventListener('click', function (e) { + if (e.target.closest('.bib-tool-detail__close')) { + e.preventDefault(); + bibCloseTool(); + return; + } + var toolBtn = e.target.closest('.bib-tool-btn'); if (toolBtn && moduleBib.contains(toolBtn)) { if (e.target.closest('.btn-aide-bib, .bib-aide-trigger, .btn-aide-trad, .btn-doc-trigger, .btn-admin-doc, .btn-trad-admin')) { diff --git a/php/inc_fx_promoteur.php b/php/inc_fx_promoteur.php index 06de3bc..68aa37e 100644 --- a/php/inc_fx_promoteur.php +++ b/php/inc_fx_promoteur.php @@ -3331,6 +3331,7 @@ function fxBibStaticFallback($clef) { 'bib_v4_summary_teams_unit' => ['fr' => 'équipes', 'en' => 'teams'], 'bib_v4_event_config_title' => ['fr' => "Configuration globale pour l'assignation de dossard", 'en' => 'Global bib assignment settings'], 'bib_v4_event_config_inter_epr_on' => ['fr' => 'Inter épreuve', 'en' => 'Inter-race'], + 'bib_v4_anomalies_nav_todo' => ['fr' => 'Élément à valider', 'en' => 'Item to review'], 'bib_v4_qty_summary_title' => ['fr' => 'Sommaire des quantités', 'en' => 'Quantity summary'], 'bib_v4_qty_summary_a_assigner' => ['fr' => 'À assigner', 'en' => 'To assign'], 'bib_v4_qty_summary_bib_restant' => ['fr' => 'Dossards restants', 'en' => 'Bibs remaining'], @@ -3578,6 +3579,7 @@ function fxBibModuleJsDataAttrs() { 'assign-full' => 'bib_v4_ajax_assign_full', 'assign-partial' => 'bib_v4_ajax_assign_partial', 'assign-none' => 'bib_v4_ajax_assign_none', + 'anomalies-nav-todo' => 'bib_v4_anomalies_nav_todo', ]; $html = ''; foreach ($map as $attr => $clef) { @@ -4411,6 +4413,23 @@ function fxBibParseGlobalBatchPlans($plans, $int_eve_id) { return $out; } +/** MSIN-4440 — Pastille tuile Anomalies (style Inter épreuve, sans compteur rouge). */ +function renderBibAnomaliesNavBadge($intCount = 0, $blnPending = false) { + if ($blnPending || (int)$intCount <= 0) { + return ''; + } + + $strLabel = fxBibTexte('bib_v4_anomalies_nav_todo', 0); + + return '' + . fxBibEsc($strLabel) + . ''; +} + /** * MSIN-4440 — Bouton tuile de la grille outils bib v4. */ @@ -4465,8 +4484,7 @@ function renderBibToolNav($int_eve_id, $tabEpreuves, $strLangue = 'fr') { } $strEventBadges = renderBibEventConfigHeaderNote($blnAllow); - $strQtyBadges = ''; - $strAnomBadges = ''; + $strAnomBadges = renderBibAnomaliesNavBadge(0, true); $strNavLabel = ($strLangue === 'en') ? 'Bib management tools' : 'Outils gestion dossards'; @@ -4475,7 +4493,7 @@ function renderBibToolNav($int_eve_id, $tabEpreuves, $strLangue = 'fr') {