Browse Source

Improved usability and strings made translatable

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

22
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++) {
var description = "";
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 {
var new_str = "";
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)
.wrap("<p></p>")
.wrap('<p></p>')
.parent());
}
var dialog = new Dialog(this, {
dialogClass: 'oe_act_window',
title: "Choose Join Node",
$content: this.$el
dialogClass: 'oe_act_window',
title: _t("Choose join node"),
$content: this.$el,
buttons: [{text: _t("Cancel"),
classes: "btn-default o_form_button_cancel",
close: true
}]
}).open();
joinnodes.find('a').click(function() {
@ -75,7 +78,6 @@ odoo.define('bi_view_editor', function (require) {
drop: function (event, ui) {
self.add_field(ui.draggable);
ui.draggable.draggable('option', 'revert', false );
ui.draggable.remove();
}
});
if (!this.get("effective_readonly")) {

1
bi_view_editor/templates/qweb_template.xml

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

Loading…
Cancel
Save