Browse Source

Improved usability and strings made translatable

pull/106/head
Andrea 8 years ago
parent
commit
eee46c7b8a
  1. 20
      bi_view_editor/static/src/js/bve.js
  2. 1
      bi_view_editor/templates/qweb_template.xml

20
bi_view_editor/static/src/js/bve.js

@ -23,24 +23,27 @@ odoo.define('bi_view_editor', function (require) {
for (var i=0; i<choices.length; i++) { for (var i=0; i<choices.length; i++) {
var description = ""; var description = "";
if (choices[i].join_node !== -1 && choices[i].table_alias !== -1) { if (choices[i].join_node !== -1 && choices[i].table_alias !== -1) {
description = "Use the field on table " + model_data[choices[i].table_alias].model_name;
description = _t("Use the field on model") + " <b>" + model_data[choices[i].table_alias].model_name + "</b>";
} else { } else {
var new_str = ""; var new_str = "";
if (choices[i].join_node !== -1) { if (choices[i].join_node !== -1) {
new_str = "new ";
new_str = "<b>" + _t("new") + "</b> ";
} }
description = "Join using the field '" + choices[i].description + "' from " + new_str + "model '" + choices[i].model_name + "'";
description = _t("<b>Join</b> using the field") + " <u><b>" + choices[i].description + "</b></u> " + _t("on ") + new_str + _t("model") +" <b>" + choices[i].model_name + "</b>";
} }
joinnodes.append($("<a>" + description+ "</a>")
joinnodes.append($('<a><input type="radio">' + description+ '</a>')
.data('idx', i) .data('idx', i)
.wrap("<p></p>")
.wrap('<p></p>')
.parent()); .parent());
} }
var dialog = new Dialog(this, { var dialog = new Dialog(this, {
dialogClass: 'oe_act_window', dialogClass: 'oe_act_window',
title: "Choose Join Node",
$content: this.$el
title: _t("Choose join node"),
$content: this.$el,
buttons: [{text: _t("Cancel"),
classes: "btn-default o_form_button_cancel",
close: true
}]
}).open(); }).open();
joinnodes.find('a').click(function() { joinnodes.find('a').click(function() {
@ -75,7 +78,6 @@ odoo.define('bi_view_editor', function (require) {
drop: function (event, ui) { drop: function (event, ui) {
self.add_field(ui.draggable); self.add_field(ui.draggable);
ui.draggable.draggable('option', 'revert', false ); ui.draggable.draggable('option', 'revert', false );
ui.draggable.remove();
} }
}); });
if (!this.get("effective_readonly")) { if (!this.get("effective_readonly")) {

1
bi_view_editor/templates/qweb_template.xml

@ -2,7 +2,6 @@
<templates id="template" xml:space="preserve"> <templates id="template" xml:space="preserve">
<t t-name="JoinNodePopup"> <t t-name="JoinNodePopup">
<div class="oe_form_nosheet"> <div class="oe_form_nosheet">
<p>Please choose the join node</p>
<div id="join-nodes"> <div id="join-nodes">
</div> </div>
</div> </div>

Loading…
Cancel
Save