[IMP] look of list-wise aggregates

bzr revid: xmo@openerp.com-20110525143516-wmav0tly51uw6ly5
This commit is contained in:
Xavier Morel 2011-05-25 16:35:16 +02:00
parent a49729461d
commit 47f7922554
2 changed files with 18 additions and 6 deletions

View File

@ -522,6 +522,17 @@ background: linear-gradient(top, #c6c6c6 0%,#5c5c5c 7%,#969595 86%); /* W3C */
text-align: right;
}
.openerp .oe-listview tfoot td {
padding: 3px 3px 0;
}
.openerp .oe-listview .oe-list-footer {
text-align: center;
white-space: nowrap;
}
.openerp .oe-listview .oe-list-footer span {
margin: 0 1em;
}
/** list rounded corners
rounded corners are a pain on tables: need to round not only table, but

View File

@ -451,12 +451,13 @@ openerp.base.ListView = openerp.base.View.extend( /** @lends openerp.base.ListVi
return aggregator;
},
display_aggregates: function (aggregation) {
var $footer = this.$element.find('.oe-list-footer');
$footer.text(
_(this.aggregate_columns).map(function (column) {
return _.sprintf(
"%s: %.2f", column.label, aggregation[column.field]);
}).join(' '));
var $footer = this.$element.find('.oe-list-footer').empty();
_(this.aggregate_columns).each(function (column) {
$(_.sprintf(
"<span>%s: %.2f</span>",
column.label, aggregation[column.field]))
.appendTo($footer);
});
}
// TODO: implement reorder (drag and drop rows)
});