From aaba22304bbc3a5de24b8be46ba375bcd7269bb9 Mon Sep 17 00:00:00 2001 From: Jailson Dias Date: Fri, 28 Apr 2017 22:56:05 -0300 Subject: [PATCH] organizando os dados em duas tabelas e com a quantidade de registros em webpage --- webpage/templates/webpages/relatorios.html | 72 +++++++++++++++++++++++++++--------------------------------------------- webpage/views.py | 24 ++++++------------------ 2 files changed, 33 insertions(+), 63 deletions(-) diff --git a/webpage/templates/webpages/relatorios.html b/webpage/templates/webpages/relatorios.html index 110ab08..90e6d09 100644 --- a/webpage/templates/webpages/relatorios.html +++ b/webpage/templates/webpages/relatorios.html @@ -21,14 +21,6 @@ json_history["data"][i][2],json_history["data"][i][3]]); } - - var array_did = []; - {%for data_json in json_did.data%} - array_did.push(["{{data_json.0}}","{{data_json.1}}","{{data_json.2}}",{% if data_json.3 is not None %}new Date('{{data_json.3.isoformat}}'){% else%}null{% endif %}]); - {% endfor%} - var json_did = {"data":array_did}; - var column_did = [{"string":'{% trans "User" %}'},{"string":'{% trans "Group" %}'},{"string":'{% trans "Action" %}'},{"date":'{% trans "Date of Action" %}'}]; - var array_n_did = []; {%for data_json in json_n_did.data%} array_n_did.push(["{{data_json.0}}","{{data_json.1}}"]); @@ -82,17 +74,12 @@ putpagination(json_n_did["data"]); } else if (col == "{{did_table}}" && text("#title-table") != "{{did_table}}"){ - if (length("#link-history") <= 0){ - add(element,"#view-table",true); - } - altertitle("{{did_table}}"); search = []; - for (var i in json_did["data"]){ - search.push([json_did["data"][i][0],json_did["data"][i][1], - json_did["data"][i][2],json_did["data"][i][3]]); + for (var i in json_history["data"]){ + search.push([json_history["data"][i][0],json_history["data"][i][1], + json_history["data"][i][2],json_history["data"][i][3]]); } - drawTable(column_did,pagination(json_did["data"],1),true,3); - putpagination(json_did["data"]); + searcher(col, true); } } chart.setSelection([]) @@ -125,7 +112,7 @@ var table = new google.visualization.Table(document.getElementById('table_div')); - table.draw(data_table, {showRowNumber: true, width: '100%', height: '100%'}); + table.draw(data_table, {allowHtml: true, cssClassNames : {tableRow: 'text-center',tableCell: 'text-center', headerCell: 'text-center'},showRowNumber: true, width: '100%', height: '100%'}); } {% endblock%} @@ -193,7 +180,7 @@