Add a 'final' filter to registration page; coherence check on server for final and skipping

This commit is contained in:
Claude Brisson
2024-02-28 19:39:03 +01:00
parent e692dbeabb
commit 024a8e8a5e
7 changed files with 58 additions and 13 deletions

View File

@@ -434,9 +434,14 @@
}
.toggle {
display: inline-block;
padding-top: 0.2em;
display: inline-flex;
flex-flow: column nowrap;
justify-content: space-evenly;
align-items: center;
cursor: pointer;
text-align: center;
vertical-align: middle;
input {
display: none !important;
}

View File

@@ -63,6 +63,9 @@
#players-list {
max-width: 95vw;
#players tr.filtered {
display: none;
}
}
#player {

View File

@@ -199,7 +199,7 @@ onLoad(() => {
switch (e.key) {
case 'Escape': {
if (tab === '#registration') {
if ($('#player').hasClass('shown') && $('#needle')[0].value) {
if ($('#player').hasClass('shown') && searchResultShown()) {
$('#needle')[0].value = '';
initSearch();
} else {

View File

@@ -260,7 +260,7 @@ onLoad(() => {
}
}
}
$('.toggle').on('click', e => {
$('#search-form .toggle').on('click', e => {
let chk = e.target.closest('.toggle');
let checkbox = chk.find('input')[0];
checkbox.checked = !checkbox.checked;
@@ -269,6 +269,16 @@ onLoad(() => {
store(id, value);
initSearch();
});
$('#list-header .toggle').on('click', e => {
let chk = e.target.closest('.toggle');
let checkbox = chk.find('input')[0];
checkbox.checked = !checkbox.checked;
if (checkbox.checked) {
$('td.reg-status:not(.final)').forEach(node => node.parentNode.addClass('filtered'));
} else {
$('td.reg-status:not(.final)').forEach(node => node.parentNode.removeClass('filtered'));
}
});
document.on('click', e => {
let resultLine = e.target.closest('.result-line');
if (resultLine) {
@@ -320,12 +330,12 @@ onLoad(() => {
id: id,
final: newStatus
}).then(player => {
if (player !== 'error') {
cell.toggleClass('final');
standingsUpToDate = false;
pairablesUpToDate = false;
}
});
if (player !== 'error') {
cell.toggleClass('final');
standingsUpToDate = false;
pairablesUpToDate = false;
}
});
e.preventDefault();
return false;
});

View File

@@ -3,9 +3,18 @@
<div class="tab-content" id="registration-tab">
<div id="reg-view">
<div id="list-header">
<div id="filter-box" class="ui icon input">
<input type="text" id="filter" placeholder="Filter..."/>
<i class="circular times link icon"></i>
<div>
<div id="filter-box" class="ui icon input">
<input type="text" id="filter" placeholder="Filter..."/>
<i class="circular times link icon"></i>
</div>
<div class="toggle">
<input id="filter-final" name="filter-final" type="checkbox"/>
<div class="checkbox">
<div class="circle"></div>
</div>
<label>Final</label>
</div>
</div>
<div>
$parts.size() participants, $utils.countFinals($parts) confirmed.