mirror of https://github.com/OCA/web.git
[CHG] rename web_translate_dialog_page to web_translate_dialog
parent
549b31bfa9
commit
d53c5ddc03
|
@ -19,34 +19,27 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
{
|
{"name": "Web Translate Dialog",
|
||||||
"name": "Web Translate Dialog in Page view",
|
"category": "Hidden",
|
||||||
"category": "Hidden",
|
"description": """
|
||||||
"description":
|
Replace the standard translation view by an alternative one:
|
||||||
"""
|
|
||||||
Replace the standard translation dialog by an alternative one:
|
|
||||||
|
|
||||||
* Hide the buttons at right of the fields and instead
|
* Add a "Translate" button item in the "More" menu
|
||||||
* Add a "Translate" button in page view, next to "Edit"
|
* The translations are displayed in a dialog (much like the OpenERP
|
||||||
|
6.1's one)
|
||||||
* The translation dialog displays empty fields for the untranslated fields,
|
* The translation dialog displays empty fields for the untranslated fields,
|
||||||
instead of the source values.
|
instead of the source values.
|
||||||
* Autosize the text boxes
|
* Support HTML fields
|
||||||
|
|
||||||
""",
|
""",
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"depends": [
|
"depends": ['web',
|
||||||
'web',
|
],
|
||||||
|
'js': ['static/src/js/web_translate_dialog.js',
|
||||||
],
|
],
|
||||||
'js': [
|
'css': ['static/src/css/base.css',
|
||||||
'static/src/js/web_translate_dialog_page.js',
|
],
|
||||||
],
|
'qweb': ["static/src/xml/base.xml",
|
||||||
'css' : [
|
],
|
||||||
'static/src/css/base.css',
|
'auto_install': False,
|
||||||
],
|
}
|
||||||
'qweb' : [
|
|
||||||
"static/src/xml/base.xml",
|
|
||||||
],
|
|
||||||
'auto_install': False,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
openerp.web_translate_dialog_page = function (instance) {
|
openerp.web_translate_dialog = function (instance) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
@ -24,12 +24,12 @@ openerp.web_translate_dialog_page = function (instance) {
|
||||||
|
|
||||||
instance.web.View.include({
|
instance.web.View.include({
|
||||||
open_translate_dialog: function() {
|
open_translate_dialog: function() {
|
||||||
new instance.web_translate_dialog_page.TranslateDialogPage(this).open();
|
new instance.web_translate_dialog.TranslateDialog(this).open();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
instance.web_translate_dialog_page.TranslateDialogPage = instance.web.Dialog.extend({
|
instance.web_translate_dialog.TranslateDialog = instance.web.Dialog.extend({
|
||||||
template: "TranslateDialogPage",
|
template: "TranslateDialog",
|
||||||
dialog_title: {toString: function () { return _t("Translations"); }},
|
dialog_title: {toString: function () { return _t("Translations"); }},
|
||||||
init: function(parent, options, content) {
|
init: function(parent, options, content) {
|
||||||
this._super(parent,
|
this._super(parent,
|
||||||
|
@ -69,7 +69,7 @@ openerp.web_translate_dialog_page = function (instance) {
|
||||||
this.$el.find('.oe_trad_field').change(function() {
|
this.$el.find('.oe_trad_field').change(function() {
|
||||||
$(this).toggleClass('touched', ($(this).val() != $(this).attr('data-value')));
|
$(this).toggleClass('touched', ($(this).val() != $(this).attr('data-value')));
|
||||||
});
|
});
|
||||||
this.$buttons.html(QWeb.render("TranslateDialogPage.buttons"));
|
this.$buttons.html(QWeb.render("TranslateDialog.buttons"));
|
||||||
this.$buttons.find(".oe_form_translate_dialog_save_button").click(function(){
|
this.$buttons.find(".oe_form_translate_dialog_save_button").click(function(){
|
||||||
self.on_button_save();
|
self.on_button_save();
|
||||||
self.on_button_close();
|
self.on_button_close();
|
|
@ -1,6 +1,6 @@
|
||||||
<templates>
|
<templates>
|
||||||
|
|
||||||
<t t-name="TranslateDialogPage">
|
<t t-name="TranslateDialog">
|
||||||
<table t-if="widget.view.translatable_fields" class="oe_frame oe_forms oe_translation_form" border="0" cellpadding="0" cellspacing="0" width="100%">
|
<table t-if="widget.view.translatable_fields" class="oe_frame oe_forms oe_translation_form" border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="oe_form_separator" width="1%" nowrap="nowrap">
|
<td class="oe_form_separator" width="1%" nowrap="nowrap">
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
</table>
|
</table>
|
||||||
</t>
|
</t>
|
||||||
|
|
||||||
<t t-name="TranslateDialogPage.buttons">
|
<t t-name="TranslateDialog.buttons">
|
||||||
<button class="oe_form_translate_dialog_save_button oe_button oe_highlight">Save</button>
|
<button class="oe_form_translate_dialog_save_button oe_button oe_highlight">Save</button>
|
||||||
<button class="oe_form_translate_dialog_cancel_button oe_button">Cancel</button>
|
<button class="oe_form_translate_dialog_cancel_button oe_button">Cancel</button>
|
||||||
</t>
|
</t>
|
Loading…
Reference in New Issue