- Displaying number of records in result analyzer added

This commit is contained in:
Wiesner András 2024-10-08 19:35:19 +02:00
parent b820afabec
commit 821f31cd10
3 changed files with 64 additions and 43 deletions

View File

@ -31,12 +31,24 @@ function autoconvert_datetime(str) {
return filter;
}
function count_selected() {
let n = 0;
document.getElementsByName("game_select").forEach((chk) => {
if (chk.checked) {
n++;
}
});
document.getElementById("selected_n").innerText = n.toString();
}
function fetch_results() {
let filterF = document.getElementById("filter");
let orderbyF = document.getElementById("orderby");
let groupsF = document.getElementById("groups");
let best_onlyChk = document.getElementById("best_only");
let records_nS = document.getElementById("records_n");
let filter = autoconvert_datetime(filterF.value.trim());
@ -61,7 +73,7 @@ function fetch_results() {
return;
}
// let n = results.length;
records_nS.innerText = results.length;
results.forEach((record) => {
let row = document.createElement("tr");
@ -89,6 +101,9 @@ function fetch_results() {
selectChk.type = "checkbox";
selectChk.name = "game_select";
selectChk.record = record;
selectChk.addEventListener("input", () => {
count_selected();
});
let selection_cell = create_cell();
selection_cell.append(selectChk);
@ -211,6 +226,7 @@ function toggle_test_selection() {
game_selectChks.forEach((chk) => {
chk.checked = !chk.checked;
});
count_selected();
}
function delete_tests() {

View File

@ -55,8 +55,7 @@ if (!$gameMgr->getGame($game_id)->isUserContributorOrOwner($user_data["nickname"
<input type="button" value="Kijelöltek törlése" onclick="delete_tests()"><br>
<input type="checkbox" id="best_only"><label for="best_only" style="font-size: 12px">Csak legjobb eredmények felhasználónként</label>
</section>
<section>
<section id="table_section">
<section id="table_section">
<table class="management">
<thead>
<tr>
@ -96,7 +95,9 @@ if (!$gameMgr->getGame($game_id)->isUserContributorOrOwner($user_data["nickname"
<tbody id="results_display">
</tbody>
</table>
</section>
</section>
<section id="summary_section">
<span id="records_n">0</span>&nbsp;találat, <span id="selected_n">0</span>&nbsp;kijelölve
</section>
<script>
let GAMEID = <?="$game_id"?>;

View File

@ -1,9 +1,13 @@
section#table_section {
position: sticky;
height: calc(100vh - 4em);
height: calc(100vh - 6em);
overflow-y: auto;
}
section#summary_section {
margin-top: 0.5em;
}
table.management {
width: 100%;
border-collapse: collapse;