[IMP] displays a nice message when the graph view has no data to display (addon web_graph)

bzr revid: ged@openerp.com-20131224153735-on6cx12v7x2r1ln0
This commit is contained in:
Gery Debongnie 2013-12-24 16:37:35 +01:00
parent 69f6efa000
commit d145c7a8c4
3 changed files with 17 additions and 2 deletions

View File

@ -4,6 +4,10 @@
text-align: right;
}
.graph_main_content .oe_view_nocontent_create:before {
background-image: none !important;
}
td.graph_border {
background-color: rgb(227, 227, 227);
text-align: left;

View File

@ -272,6 +272,7 @@ instance.web_graph.Graph = instance.web.Widget.extend({
display_data: function () {
this.$('.graph_main_content svg').remove();
this.$('.graph_main_content div').remove();
this.table.empty();
if (this.visible_ui) {
@ -280,8 +281,9 @@ instance.web_graph.Graph = instance.web.Widget.extend({
this.$('.graph_header').css('display', 'none');
}
if (this.pivot.no_data) {
var msg = 'No data available. Try to remove any filter or add some data.';
this.table.append($('<tr><td>' + msg + '</td></tr>'));
this.$('.graph_main_content').append($(QWeb.render('graph_no_data')));
// var msg = 'No data available. Try to remove any filter or add some data.';
// this.table.append($('<tr><td>' + msg + '</td></tr>'));
} else {
var table_modes = ['pivot', 'heatmap', 'row_heatmap', 'col_heatmap'];
if (_.contains(table_modes, this.mode)) {

View File

@ -52,4 +52,13 @@
</ul>
</div>
<div t-name="graph_no_data" class="oe_view_nocontent" >
<p class="oe_view_nocontent_create">
No data to display.
</p>
<p>
No data are available. Try to add some records, or make sure
that there is no active filter in the search bar.
</p>
</div>
</templates>