From d64b18c9fbf4c47cf19e41e7a9c7793c4cb2f391 Mon Sep 17 00:00:00 2001 From: stephan Date: Thu, 18 Jun 2026 16:24:24 -0400 Subject: [PATCH] Refactor mobile registration status management to use select elements; update version code This commit modifies the mobile registration interface to replace radio buttons with a select dropdown for participant status management. The JavaScript and CSS are updated accordingly to enhance user interaction and maintain layout consistency. The version code is incremented to 4.72.674 to reflect these changes, further improving the mobile user experience. --- css/style.css | 44 ++++++------------------------ inc_footer_scripts.php | 19 +++++++++---- php/inc_fx_inscriptions_mobile.php | 20 ++++---------- php/inc_settings.php | 2 +- 4 files changed, 29 insertions(+), 56 deletions(-) diff --git a/css/style.css b/css/style.css index 809a794..4cc97f5 100644 --- a/css/style.css +++ b/css/style.css @@ -2579,47 +2579,21 @@ a.ms1-trad-link.btn-aide-trad{ gap:8px; } -.inscr-mobile-statut-radio{ - display:flex; - flex-direction:column; - gap:6px; -} - -.inscr-mobile-statut-option{ - display:flex; - align-items:center; - gap:8px; - margin:0; - padding:8px 10px; - border:1px solid #dee2e6; - border-radius:4px; - background:#f8f9fa; +.inscr-mobile-statut-select{ + max-width:100%; font-size:14px; - font-weight:500; - cursor:pointer; + padding:6px 10px; + height:auto; + min-height:34px; } -.inscr-mobile-statut-option:has(.inscr-mobile-statut-option__input:checked){ - border-color:#0d6efd; - background:#e7f1ff; -} - -.inscr-mobile-statut-option__input{ - margin:0; - flex-shrink:0; -} - -.inscr-mobile-statut-option__label{ - flex:1; - line-height:1.3; -} - -.inscr-mobile-field-block--statut.inscr-mobile-statut--saved .inscr-mobile-statut-option:has(.inscr-mobile-statut-option__input:checked){ +.inscr-mobile-field-block--statut.inscr-mobile-statut--saved .inscr-mobile-statut-select{ border-color:#198754; - background:#d1e7dd; + background-color:#d1e7dd; } -.inscr-mobile-field-block--statut.inscr-mobile-statut--error{ +.inscr-mobile-field-block--statut.inscr-mobile-statut--error .inscr-mobile-statut-select{ + border-color:#dc3545; animation:inscr-mobile-statut-shake .35s ease; } diff --git a/inc_footer_scripts.php b/inc_footer_scripts.php index 1c135cd..6de23ed 100644 --- a/inc_footer_scripts.php +++ b/inc_footer_scripts.php @@ -3458,12 +3458,12 @@ if ($strLangue == 'fr') { var pendingStatutXhr = null; var lastStatutParId = null; - $body.on('change', '.inscr-mobile-statut-option__input', function () { - var $input = $(this); - var $group = $input.closest('.inscr-mobile-statut-radio'); - var $block = $input.closest('.inscr-mobile-field-block--statut'); - var intParId = $group.data('par_id'); - var strCode = $input.val(); + $body.on('change', '.inscr-mobile-statut-select', function () { + var $select = $(this); + var $block = $select.closest('.inscr-mobile-field-block--statut'); + var intParId = $select.data('par_id'); + var strCode = $select.val(); + var strPrev = $select.data('prev'); if (!intParId || !strCode) { return; @@ -3487,20 +3487,27 @@ if ($strLangue == 'fr') { pendingStatutXhr = null; $preloader.fadeOut('slow'); if (result && result.state === 'success') { + $select.data('prev', strCode); $block.addClass('inscr-mobile-statut--saved'); window.setTimeout(function () { $block.removeClass('inscr-mobile-statut--saved'); }, 1200); } else { + $select.val(strPrev); $block.addClass('inscr-mobile-statut--error'); } }, 'json').fail(function () { pendingStatutXhr = null; $preloader.fadeOut('slow'); + $select.val(strPrev); $block.addClass('inscr-mobile-statut--error'); }); }); + moduleInscr.querySelectorAll('.inscr-mobile-statut-select').forEach(function (el) { + el.dataset.prev = el.value; + }); + var params = new URLSearchParams(window.location.search); if (params.get('pec_id')) { moduleInscr.scrollIntoView({block: 'start'}); diff --git a/php/inc_fx_inscriptions_mobile.php b/php/inc_fx_inscriptions_mobile.php index ecf1595..58cfd77 100644 --- a/php/inc_fx_inscriptions_mobile.php +++ b/php/inc_fx_inscriptions_mobile.php @@ -220,9 +220,9 @@ function fxInscrMobileRenderStatutField($intParId, $strCurrent, $intEveId, $strL } $strCurrent = fxInscrMobileResolveParStatutCourse($strCurrent); - $strGroupName = 'inscr_statut_' . (int)$intParId; + $strSelectId = 'inscr_statut_' . (int)$intParId; - echo '
'; @@ -233,20 +233,12 @@ function fxInscrMobileRenderStatutField($intParId, $strCurrent, $intEveId, $strL continue; } - $strInputId = $strGroupName . '_' . preg_replace('/[^a-zA-Z0-9_-]/', '_', $strCode); - $blnChecked = ($strCurrent === $strCode); - - echo ''; + echo ''; } - echo '
'; + echo ''; } /** Paramètres GET pour liens (sans double-encodage). */ diff --git a/php/inc_settings.php b/php/inc_settings.php index 38b646b..8493dfc 100644 --- a/php/inc_settings.php +++ b/php/inc_settings.php @@ -7,7 +7,7 @@ * Constantes * * **************/ -define('_VERSION_CODE', '4.72.673'); +define('_VERSION_CODE', '4.72.674'); define('_DATE_CODE', '2026-06-18'); //MSIN-4290 define('QR_SECRET_KEY', 'ms1_qr_2026_cle_secrete_longue_et_fixe');