Fix results page sorting and filtering
This commit is contained in:
@@ -509,7 +509,7 @@
|
|||||||
margin-top: 0.1em !important;
|
margin-top: 0.1em !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#logo, #lang, .steps, #filter-box, #footer, #unpairables, #pairing-buttons, button, #standings-params, #logout, .pairing-stats, .result-sheets, .toggle {
|
#logo, #lang, .steps, #filter-box, #reglist-mode, #footer, #unpairables, #pairing-buttons, button, #standings-params, #logout, .pairing-stats, .result-sheets, .toggle {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -285,6 +285,10 @@
|
|||||||
|
|
||||||
/* results section */
|
/* results section */
|
||||||
|
|
||||||
|
#results-filter {
|
||||||
|
margin-left: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
#results-list {
|
#results-list {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
.player, .result {
|
.player, .result {
|
||||||
|
@@ -53,12 +53,13 @@ onLoad(()=>{
|
|||||||
let newResult = results[(index + 1)%results.length];
|
let newResult = results[(index + 1)%results.length];
|
||||||
setResult(gameId, newResult, oldResult);
|
setResult(gameId, newResult, oldResult);
|
||||||
});
|
});
|
||||||
$('#filter').on('click', e=>{
|
$('#results-filter').on('click', e => {
|
||||||
let filter = $('#filter-results')[0].checked;
|
let filter = $('#results-filter input')[0];
|
||||||
if (filter) {
|
filter.checked = !filter.checked;
|
||||||
$('#results-table tr').filter(':not(:has(td.result[data-result="?"]))').addClass('filtered');
|
if (filter.checked) {
|
||||||
|
$('#results-table tbody tr').filter(':not(:has(td.result[data-result="?"]))').addClass('filtered');
|
||||||
} else {
|
} else {
|
||||||
$('#results-table tr').removeClass('filtered');
|
$('#results-table tbody tr').removeClass('filtered');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
<button class="ui floating choose-round next-round button">»</button>
|
<button class="ui floating choose-round next-round button">»</button>
|
||||||
#set($stats = $utils.getResultsStats($games))
|
#set($stats = $utils.getResultsStats($games))
|
||||||
<span class="norbeak">( <span id="known">$stats.known</span> / $stats.total )</span>
|
<span class="norbeak">( <span id="known">$stats.known</span> / $stats.total )</span>
|
||||||
<div id="filter" class="toggle">
|
<div id="results-filter" class="toggle">
|
||||||
<input id="filter-results" type="checkbox" value="true"/>
|
<input type="checkbox" value="true"/>
|
||||||
<div class="filter-results checkbox">
|
<div class="filter-results checkbox">
|
||||||
<div class="circle"></div>
|
<div class="circle"></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<div id="results-list" class="roundbox">
|
<div id="results-list" class="roundbox">
|
||||||
<table id="results-table" class="ui celled striped table">
|
<table id="results-table" class="ui celled striped table">
|
||||||
<thead class="centered">
|
<thead class="centered">
|
||||||
<th>table</th>
|
<th data-sort-method="number">table</th>
|
||||||
<th>white</th>
|
<th>white</th>
|
||||||
<th>black</th>
|
<th>black</th>
|
||||||
<th>result</th>
|
<th>result</th>
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
#set($black = $pmap[$game.b])
|
#set($black = $pmap[$game.b])
|
||||||
#if($black && $white)
|
#if($black && $white)
|
||||||
<tr id="result-$game.id" data-id="$game.id">
|
<tr id="result-$game.id" data-id="$game.id">
|
||||||
<td>#$game.t</td>
|
<td data-sort="$game.t">#$game.t</td>
|
||||||
<td class="white player #if($game.r == 'w' || $game.r == '#') winner #elseif($game.r == 'b' || $game.r == '0') looser #end" data-id="$white.id" data-sort="$white.name $white.firstname"><span>#if($white)$white.name $white.firstname #rank($white.rank)#{else}BIP#end</span></td>
|
<td class="white player #if($game.r == 'w' || $game.r == '#') winner #elseif($game.r == 'b' || $game.r == '0') looser #end" data-id="$white.id" data-sort="$white.name $white.firstname"><span>#if($white)$white.name $white.firstname #rank($white.rank)#{else}BIP#end</span></td>
|
||||||
<td class="black player #if($game.r == 'b' || $game.r == '#') winner #elseif($game.r == 'w' || $game.r == '0') looser #end" data-id="$black.id" data-sort="$black.name $black.firstname"><span>#if($black)$black.name $black.firstname #rank($black.rank)#{else}BIP#end</span></td>
|
<td class="black player #if($game.r == 'b' || $game.r == '#') winner #elseif($game.r == 'w' || $game.r == '0') looser #end" data-id="$black.id" data-sort="$black.name $black.firstname"><span>#if($black)$black.name $black.firstname #rank($black.rank)#{else}BIP#end</span></td>
|
||||||
<td class="result centered" data-sort="$game.r" data-result="$game.r">$dispRst[$game.r]</td>
|
<td class="result centered" data-sort="$game.r" data-result="$game.r">$dispRst[$game.r]</td>
|
||||||
|
Reference in New Issue
Block a user