[FIX] kinda sorta rename add to dashboard feature to add to reporting according to apr's wishes

also change button from 'save' to 'add'

bzr revid: xmo@openerp.com-20120801135803-j4wwbdm2ngdz4koo
This commit is contained in:
Xavier Morel 2012-08-01 15:58:03 +02:00
parent cd65d4aa21
commit 3b5bd3598c
2 changed files with 12 additions and 12 deletions

View File

@ -661,7 +661,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
null, _(this.select_for_drawer()).invoke(
'appendTo', this.$element.find('.oe_searchview_drawer')));
new instance.web.search.AddToDashboard(this).appendTo($('.oe_searchview_drawer', this.$element));
new instance.web.search.AddToReporting(this).appendTo($('.oe_searchview_drawer', this.$element));
// load defaults
var defaults_fetched = $.when.apply(null, _(this.inputs).invoke(
@ -1678,8 +1678,8 @@ instance.web.search.Filters = instance.web.search.Input.extend({
}));
}
});
instance.web.search.AddToDashboard = instance.web.Widget.extend({
template: 'SearchView.addtodashboard',
instance.web.search.AddToReporting = instance.web.Widget.extend({
template: 'SearchView.addtoreporting',
_in_drawer: true,
start: function () {
var self = this;
@ -1706,9 +1706,10 @@ instance.web.search.AddToDashboard = instance.web.Widget.extend({
return menu ? menu.children : [];
});
},
render_data: function(dashboard_data){
render_data: function(dashboard_choices){
var selection = instance.web.qweb.render(
"SearchView.addtodashboard.selection", {selections: dashboard_data});
"SearchView.addtoreporting.selection", {
selections: dashboard_choices});
this.$("input").before(selection)
},
add_dashboard:function(){

View File

@ -1443,16 +1443,15 @@
<div>
</div>
</div>
<div t-name="SearchView.addtodashboard" class="oe_searchview_dashboard">
<h4>Add to Dashboard</h4>
<div t-name="SearchView.addtoreporting" class="oe_searchview_dashboard">
<h4>Add to Reporting</h4>
<form>
<p><input placeholder="Title of new Dashboard item"
title="Title of new Dashboard item" type="text"/></p>
<button class="oe_apply" type="submit">Save</button>
<p><input placeholder="Title of new dashboard item"/></p>
<button class="oe_apply" type="submit">Add</button>
</form>
</div>
<t t-name="SearchView.addtodashboard.selection">
<select title="Select Dashboard to add this filter to">
<t t-name="SearchView.addtoreporting.selection">
<select>
<option t-foreach="selections" t-as="element"
t-att-value="element.id || element.res_id ">
<t t-esc="element.name"/></option>