[IMP] improves the look of the total in each rows in pivot table view (addon web_graph)

bzr revid: ged@openerp.com-20131125091505-wts1llbdexhnl8fe
This commit is contained in:
Gery Debongnie 2013-11-25 10:15:05 +01:00
parent 7940ec40c6
commit d8aa7a6551
1 changed files with 8 additions and 2 deletions

View File

@ -284,7 +284,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
make_cells(pivot.cols.headers, 0);
} else {
make_cells(pivot.cols.main.children, 1);
header_cells[0].push(self.make_border_cell(1, height).append('Total'));
header_cells[0].push(self.make_border_cell(1, height).append('Total').css('font-weight', 'bold'));
}
_.each(header_cells, function (cells) {
@ -323,10 +323,16 @@ instance.web_graph.GraphView = instance.web.View.extend({
html_row.append(cell);
}
});
var cell = $('<td></td>').append(pivot.get_value(row.id,pivot.cols.main.id));
var total = pivot.get_value(row.id, pivot.cols.main.id);
var cell = $('<td></td>')
.append(total)
.css('font-weight', 'bold');
if (row.is_expanded && (row.path.length <= 2)) {
var color = row.path.length * 5 + 240;
cell.css("background-color", "rgb(" + [color, color, color].join() + ")");
} else if (self.heat_map_mode) {
var color = Math.floor(50 + 205*(pivot.total - total)/pivot.total);
cell.css("background-color", "rgb(255," + color + "," + color + ")");
}
if (pivot.cols.main.children.length > 0) {