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.
This commit is contained in:
2026-06-18 16:24:24 -04:00
parent 2cb6a59c96
commit d64b18c9fb
4 changed files with 29 additions and 56 deletions

View File

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

View File

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

View File

@ -220,9 +220,9 @@ function fxInscrMobileRenderStatutField($intParId, $strCurrent, $intEveId, $strL
}
$strCurrent = fxInscrMobileResolveParStatutCourse($strCurrent);
$strGroupName = 'inscr_statut_' . (int)$intParId;
$strSelectId = 'inscr_statut_' . (int)$intParId;
echo '<div class="inscr-mobile-statut-radio" role="radiogroup"'
echo '<select class="form-control rounded-0 inscr-mobile-statut-select" id="' . fxInscrMobileEsc($strSelectId) . '"'
. ' data-par_id="' . (int)$intParId . '"'
. ' data-eve_id="' . rawurlencode(base64_encode((string)$intEveId)) . '">';
@ -233,20 +233,12 @@ function fxInscrMobileRenderStatutField($intParId, $strCurrent, $intEveId, $strL
continue;
}
$strInputId = $strGroupName . '_' . preg_replace('/[^a-zA-Z0-9_-]/', '_', $strCode);
$blnChecked = ($strCurrent === $strCode);
echo '<label class="inscr-mobile-statut-option" for="' . fxInscrMobileEsc($strInputId) . '">';
echo '<input class="inscr-mobile-statut-option__input" type="radio"'
. ' name="' . fxInscrMobileEsc($strGroupName) . '"'
. ' id="' . fxInscrMobileEsc($strInputId) . '"'
. ' value="' . fxInscrMobileEsc($strCode) . '"'
. ($blnChecked ? ' checked' : '') . '>';
echo '<span class="inscr-mobile-statut-option__label">' . fxInscrMobileEsc($strLabel) . '</span>';
echo '</label>';
echo '<option value="' . fxInscrMobileEsc($strCode) . '"'
. ($strCurrent === $strCode ? ' selected' : '') . '>'
. fxInscrMobileEsc($strLabel) . '</option>';
}
echo '</div>';
echo '</select>';
}
/** Paramètres GET pour liens (sans double-encodage). */

View File

@ -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');