From 8f237d4936186e45acb1eb9783e7b22ce79574e5 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 17 Jul 2024 10:26:08 +0200 Subject: [PATCH 1/2] Add column with diff to last period --- application/views/accumulate/index.php | 1 + assets/js/sections/accumulatedstatistics.js | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/application/views/accumulate/index.php b/application/views/accumulate/index.php index 0ced9a2b8..a7653307c 100644 --- a/application/views/accumulate/index.php +++ b/application/views/accumulate/index.php @@ -8,6 +8,7 @@ var lang_general_word_yearly = ''; var lang_general_word_month = ''; var lang_general_word_monthly = ''; + var lang_general_word_diff = '';

diff --git a/assets/js/sections/accumulatedstatistics.js b/assets/js/sections/accumulatedstatistics.js index 765057d1d..36f4e2fa9 100644 --- a/assets/js/sections/accumulatedstatistics.js +++ b/assets/js/sections/accumulatedstatistics.js @@ -72,6 +72,9 @@ function accumulatePlot(form) { "" + awardtext + "" + + "" + + lang_general_word_diff + + "" + "" + "" + "" @@ -81,6 +84,7 @@ function accumulatePlot(form) { var $myTable = $(".accutable"); var i = 1; + var last_total = 0; // building the rows in the table var rowElements = data.map(function (row) { @@ -89,8 +93,11 @@ function accumulatePlot(form) { var $iterator = $("").html(i++); var $type = $("").html(row.year); var $content = $("").html(row.total); + diff = row.total - last_total; + var $diff = $("").html((last_total == 0 || diff == 0) ? '' : "+"+diff); + last_total = row.total; - $row.append($iterator, $type, $content); + $row.append($iterator, $type, $content, $diff); return $row; }); From 55d58462ee1b0a8acd45d22bacc78914907f0605 Mon Sep 17 00:00:00 2001 From: int2001 Date: Wed, 17 Jul 2024 11:18:20 +0000 Subject: [PATCH 2/2] Added ability to sort to the Acc-Tables --- assets/js/sections/accumulatedstatistics.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/assets/js/sections/accumulatedstatistics.js b/assets/js/sections/accumulatedstatistics.js index 36f4e2fa9..9346b4b7a 100644 --- a/assets/js/sections/accumulatedstatistics.js +++ b/assets/js/sections/accumulatedstatistics.js @@ -65,16 +65,16 @@ function accumulatePlot(form) { $("#accumulateTable").append( '' + "" + - "" + - "" + + "" + "" + "" + "
#" + + "#" + periodtext + - "" + - "" + + "" + + "" + awardtext + - "" + - "" + + "" + + "" + lang_general_word_diff + - "" + + "
" @@ -163,11 +163,11 @@ function accumulatePlot(form) { $(".ld-ext-right").prop("disabled", false); $(".accutable").DataTable({ responsive: false, - ordering: false, scrollY: "400px", scrollCollapse: true, paging: false, scrollX: true, + sortable: true, language: { url: getDataTablesLanguageUrl(), },