Enhance bib tool styles and functionality, increment version code to 4.72.770

This commit introduces new CSS styles for the bib tool buttons and detail panel, improving their visual presentation and interactivity. It also adds functionality for displaying anomaly navigation badges, enhancing user experience. The version code is incremented to 4.72.770 to reflect these updates.
This commit is contained in:
2026-07-08 14:55:53 -04:00
parent 885dcf9b8f
commit 6dd1ca3aad
5 changed files with 138 additions and 10 deletions

View File

@ -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;
}

View File

@ -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 = '<span class="epr-header-summary bib-event-config-note bib-anomalies-nav-badge"'
+ ' data-bib-anomalies-nav-badge="1"'
+ ' title="' + strTodo.replace(/"/g, '&quot;') + '">'
+ strTodo
+ '</span>';
}
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')) {

View File

@ -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 '<span class="epr-header-summary bib-event-config-note bib-anomalies-nav-badge'
. fxBibUiHiddenClass(true)
. '" data-bib-anomalies-nav-badge="1" aria-hidden="true"></span>';
}
$strLabel = fxBibTexte('bib_v4_anomalies_nav_todo', 0);
return '<span class="epr-header-summary bib-event-config-note bib-anomalies-nav-badge"'
. ' data-bib-anomalies-nav-badge="1"'
. ' title="' . fxBibEsc($strLabel) . '">'
. fxBibEsc($strLabel)
. '</span>';
}
/**
* 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 = '<span class="bib-qty-summary-badges bib-qty-summary-badges--pending" aria-hidden="true">…</span>';
$strAnomBadges = '<span class="bib-anomalies-count badge badge-secondary" aria-busy="true">…</span>';
$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') {
<div class="bib-tool-hub">
<nav class="bib-tool-nav" aria-label="<?php echo fxBibEsc($strNavLabel); ?>">
<?php echo renderBibToolNavBtn('event_config', 'bib_v4_event_config_title', $strEventBadges); ?>
<?php echo renderBibToolNavBtn('qty_summary', 'bib_v4_qty_summary_title', $strQtyBadges); ?>
<?php echo renderBibToolNavBtn('qty_summary', 'bib_v4_qty_summary_title'); ?>
<?php echo renderBibToolNavBtn('anomalies', 'bib_v4_anomalies_title', $strAnomBadges); ?>
<?php echo renderBibToolNavBtn('dist_print', 'bib_v4_dist_print_title'); ?>
<?php if ($intSolo >= 2) {
@ -4485,6 +4503,12 @@ function renderBibToolNav($int_eve_id, $tabEpreuves, $strLangue = 'fr') {
<div id="bib-tool-detail" class="bib-tool-detail bib-ui-hidden" aria-live="polite">
<div class="bib-tool-detail__header epr-header">
<span id="bib-tool-detail-title" class="bib-tool-detail__title"></span>
<button type="button"
class="bib-tool-detail__close epr-block-toggle"
aria-label="<?php echo fxBibEsc(fxBibTexte('bib_v4_view_close', 0)); ?>"
title="<?php echo fxBibEsc(fxBibTexte('bib_v4_view_close', 0)); ?>">
<i class="fa fa-times" aria-hidden="true"></i>
</button>
</div>
<div id="bib-tool-detail-body" class="bib-tool-detail__body"></div>
</div>

View File

@ -7,7 +7,7 @@
* Constantes *
*
**************/
define('_VERSION_CODE', '4.72.767');
define('_VERSION_CODE', '4.72.770');
define('_DATE_CODE', '2026-07-08');
//MSIN-4290
define('QR_SECRET_KEY', 'ms1_qr_2026_cle_secrete_longue_et_fixe');

View File

@ -0,0 +1,9 @@
-- MSIN-4440 — Pastille tuile Anomalies (grille outils bib v4)
-- Libellé « Élément à valider » sur la tuile, style Inter épreuve (pas de compteur rouge).
-- Idempotent.
SELECT 'bib_v4_anomalies_nav_todo', 'fr', 'Élément à valider', 'Pastille tuile Anomalies quand au moins une anomalie est ouverte.', 'compte.php', '', 0, 1, '', '', '', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_anomalies_nav_todo' AND info_langue = 'fr' AND info_prg = 'compte.php');
SELECT 'bib_v4_anomalies_nav_todo', 'en', 'Item to review', 'Anomalies tool tile badge when at least one issue is present.', 'compte.php', '', 0, 1, '', '', '', NOW()
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM info WHERE info_clef = 'bib_v4_anomalies_nav_todo' AND info_langue = 'en' AND info_prg = 'compte.php');