mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
@@ -8,6 +8,7 @@
|
||||
var lang_general_word_yearly = '<?= __("Yearly"); ?>';
|
||||
var lang_general_word_month = '<?= __("Month"); ?>';
|
||||
var lang_general_word_monthly = '<?= __("Monthly"); ?>';
|
||||
var lang_general_word_diff = '<?= __("Difference"); ?>';
|
||||
</script>
|
||||
<div class="container">
|
||||
<h2><?php echo $page_title; ?></h1>
|
||||
|
||||
@@ -65,13 +65,16 @@ function accumulatePlot(form) {
|
||||
$("#accumulateTable").append(
|
||||
'<table style="width:100%" class="accutable table table-sm table-bordered table-hover table-striped table-condensed text-center"><thead>' +
|
||||
"<tr>" +
|
||||
"<td>#</td>" +
|
||||
"<td>" +
|
||||
"<th>#</th>" +
|
||||
"<th>" +
|
||||
periodtext +
|
||||
"</td>" +
|
||||
"<td>" +
|
||||
"</th>" +
|
||||
"<th>" +
|
||||
awardtext +
|
||||
"</td>" +
|
||||
"</th>" +
|
||||
"<th>" +
|
||||
lang_general_word_diff +
|
||||
"</th>" +
|
||||
"</tr>" +
|
||||
"</thead>" +
|
||||
"<tbody></tbody></table>"
|
||||
@@ -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 = $("<td></td>").html(i++);
|
||||
var $type = $("<td></td>").html(row.year);
|
||||
var $content = $("<td></td>").html(row.total);
|
||||
diff = row.total - last_total;
|
||||
var $diff = $("<td></td>").html((last_total == 0 || diff == 0) ? '' : "+"+diff);
|
||||
last_total = row.total;
|
||||
|
||||
$row.append($iterator, $type, $content);
|
||||
$row.append($iterator, $type, $content, $diff);
|
||||
|
||||
return $row;
|
||||
});
|
||||
@@ -156,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(),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user