From dc55a855c30fcf575249d7f68eefb2a16bb25dca Mon Sep 17 00:00:00 2001 From: stephan Date: Thu, 9 Jul 2026 11:44:15 -0400 Subject: [PATCH] Enhance anomaly block styles and functionality, increment version code to 4.72.779 This commit introduces new styles for the anomaly blocks, including collapsible sections and improved padding. The JavaScript is updated to handle click and keyboard events for toggling these sections, enhancing user interaction. The version code is incremented to 4.72.779 to reflect these changes. --- css/style.css | 47 ++++++++++++++++-- js/v2/bib-assignments.js | 70 ++++++++++++++++++++++---- php/inc_fx_promoteur.php | 103 ++++++++++++++++++++++----------------- php/inc_settings.php | 2 +- 4 files changed, 161 insertions(+), 61 deletions(-) diff --git a/css/style.css b/css/style.css index 5d3df9a..da87bf1 100644 --- a/css/style.css +++ b/css/style.css @@ -3003,6 +3003,7 @@ a.ms1-trad-link.btn-aide-trad{ .bib-anomalies-content{ background:#fff; + padding:8px; } .bib-dist-print-panel{ @@ -3048,12 +3049,50 @@ a.ms1-trad-link.btn-aide-trad{ } .bib-anomaly-block{ - padding:10px 12px; - border-top:1px solid #e9ecef; + margin-bottom:8px; + border:1px solid #c5d9f5; + border-radius:6px; + overflow:hidden; + background:#fff; } -.bib-anomaly-block:first-child{ - border-top:none; +.bib-anomaly-block:last-child{ + margin-bottom:0; +} + +.bib-anomaly-block-header{ + margin:0; + padding:8px 10px; + font-size:13px; + font-weight:700; + cursor:pointer; + user-select:none; +} + +.bib-anomaly-block-header .epr-header-label{ + font-size:13px; + font-weight:700; +} + +.bib-anomaly-block-header .btn-aide-bib{ + color:#fff; +} + +.bib-anomaly-block-count{ + font-size:11px; + min-width:1.6em; + justify-content:center; + text-align:center; +} + +.bib-anomaly-block.is-collapsed .bib-anomaly-block-content{ + display:none; +} + +.bib-anomaly-block-content{ + padding:10px 12px; + border-top:1px solid #c5d9f5; + background:#fff; } .bib-anomaly-block-title{ diff --git a/js/v2/bib-assignments.js b/js/v2/bib-assignments.js index 0fe66b1..0c6e974 100644 --- a/js/v2/bib-assignments.js +++ b/js/v2/bib-assignments.js @@ -1192,18 +1192,17 @@ }); } - // MSIN-4379 — Réduire / développer les blocs gestion et assignation (en-tête seul visible). - moduleBib.addEventListener('click', function (e) { - let btnToggle = e.target.closest('.epr-block-toggle'); - if (!btnToggle || !moduleBib.contains(btnToggle)) { - return; - } - let block = btnToggle.closest('.epr-block'); - if (!block || block.closest('#bib-tool-store')) { + // MSIN-4379 — Réduire / développer les blocs gestion, assignation et sections anomalies. + function bibToggleCollapsibleBlock(block, btnToggle) { + if (!block || !btnToggle) { return; } let collapsed = block.classList.toggle('is-collapsed'); btnToggle.setAttribute('aria-expanded', collapsed ? 'false' : 'true'); + let hdr = block.querySelector('.bib-anomaly-block-header'); + if (hdr) { + hdr.setAttribute('aria-expanded', collapsed ? 'false' : 'true'); + } let label = collapsed ? (btnToggle.getAttribute('data-label-expand') || '') : (btnToggle.getAttribute('data-label-collapse') || ''); @@ -1216,20 +1215,71 @@ icon.classList.toggle('fa-chevron-up', !collapsed); icon.classList.toggle('fa-chevron-down', collapsed); } + } + + moduleBib.addEventListener('click', function (e) { + if (e.target.closest('.btn-aide-bib, .bib-aide-trigger, .btn-aide-trad, .btn-doc-trigger, .btn-admin-doc, .btn-trad-admin, .ms1-trad-link')) { + return; + } + + let anomalyHdr = e.target.closest('.bib-anomaly-block-header'); + if (anomalyHdr && moduleBib.contains(anomalyHdr) && !e.target.closest('.epr-block-toggle')) { + e.preventDefault(); + let anomalyBlock = anomalyHdr.closest('.bib-anomaly-block'); + let anomalyBtn = anomalyHdr.querySelector('.epr-block-toggle'); + if (anomalyBlock && anomalyBtn) { + bibToggleCollapsibleBlock(anomalyBlock, anomalyBtn); + } + return; + } + + let btnToggle = e.target.closest('.epr-block-toggle'); + if (!btnToggle || !moduleBib.contains(btnToggle)) { + return; + } + + let anomalyBlock = btnToggle.closest('.bib-anomaly-block'); + if (anomalyBlock) { + e.preventDefault(); + bibToggleCollapsibleBlock(anomalyBlock, btnToggle); + return; + } + + let block = btnToggle.closest('.epr-block'); + if (!block || block.closest('#bib-tool-store')) { + return; + } + bibToggleCollapsibleBlock(block, btnToggle); // MSIN-4424 — Sommaire quantités : chargement à la première ouverture (accordéon épreuve). - if (!collapsed && block.id === 'bib-qty-summary-panel' + if (!block.classList.contains('is-collapsed') && block.id === 'bib-qty-summary-panel' && block.getAttribute('data-bib-qty-summary-deferred') === '1') { refreshBibQtySummaryPanel(); } // MSIN-4433 — Impression PDF : chargement à la première ouverture (accordéon épreuve). - if (!collapsed && block.id === 'bib-dist-print-panel' + if (!block.classList.contains('is-collapsed') && block.id === 'bib-dist-print-panel' && block.getAttribute('data-bib-dist-print-deferred') === '1') { refreshBibDistPrintPanel(); } }); + moduleBib.addEventListener('keydown', function (e) { + if (e.key !== 'Enter' && e.key !== ' ') { + return; + } + let anomalyHdr = e.target.closest('.bib-anomaly-block-header'); + if (!anomalyHdr || !moduleBib.contains(anomalyHdr)) { + return; + } + e.preventDefault(); + let anomalyBlock = anomalyHdr.closest('.bib-anomaly-block'); + let anomalyBtn = anomalyHdr.querySelector('.epr-block-toggle'); + if (anomalyBlock && anomalyBtn) { + bibToggleCollapsibleBlock(anomalyBlock, anomalyBtn); + } + }); + // ============================================================ // MSIN-4379 — Tippy.js (module #module-bib uniquement) // info_texte → data-tippy-content (tip court) diff --git a/php/inc_fx_promoteur.php b/php/inc_fx_promoteur.php index abda809..3febeab 100644 --- a/php/inc_fx_promoteur.php +++ b/php/inc_fx_promoteur.php @@ -4509,7 +4509,7 @@ function renderBibToolNav($int_eve_id, $tabEpreuves, $strLangue = 'fr') { = 2) { - echo renderBibToolNavBtn('global_batch', 'bib_v4_global_batch_title', '', false, 'bib_v4_global_batch_doc'); + echo renderBibToolNavBtn('global_batch', 'bib_v4_global_batch_title'); } ?>
@@ -6040,6 +6040,32 @@ function renderBibAnomaliesPanelShell($int_eve_id, $strLangue = 'fr') { return ob_get_clean(); } +/** MSIN-4379 — Ouverture section anomalies repliable (fermée par défaut). */ +function fxBibAnomalySectionOpen($strVariant, $strTitleClef, $intCount, $strLangue = 'fr') { + $strVariant = preg_replace('/[^a-z0-9-]/', '', (string)$strVariant); + ?> + +

- -
-

- - - -

+
  • @@ -6107,16 +6129,13 @@ function renderBibAnomaliesPanel($int_eve_id, $strLangue = 'fr', $tabAnomalies =
-
- + - -
-

- - - -

+
  • @@ -6136,16 +6155,13 @@ function renderBibAnomaliesPanel($int_eve_id, $strLangue = 'fr', $tabAnomalies =
-
- + - -
-

- - - -

+
  • @@ -6163,16 +6179,13 @@ function renderBibAnomaliesPanel($int_eve_id, $strLangue = 'fr', $tabAnomalies =
-
- + - -
-

- - - -

+
-
- + - -
-

- - - -

+
  • @@ -6227,8 +6237,9 @@ function renderBibAnomaliesPanel($int_eve_id, $strLangue = 'fr', $tabAnomalies =
-
- +
diff --git a/php/inc_settings.php b/php/inc_settings.php index 183a2d4..ffe5e92 100644 --- a/php/inc_settings.php +++ b/php/inc_settings.php @@ -7,7 +7,7 @@ * Constantes * * **************/ -define('_VERSION_CODE', '4.72.778'); +define('_VERSION_CODE', '4.72.779'); define('_DATE_CODE', '2026-07-09'); //MSIN-4290 define('QR_SECRET_KEY', 'ms1_qr_2026_cle_secrete_longue_et_fixe');