Browse Source

[CHG] rename web_translate_dialog_page to web_translate_dialog

pull/4/head
Guewen Baconnier 11 years ago
parent
commit
d53c5ddc03
  1. 0
      web_translate_dialog/__init__.py
  2. 33
      web_translate_dialog/__openerp__.py
  3. 0
      web_translate_dialog/orm.py
  4. 0
      web_translate_dialog/static/src/css/base.css
  5. 10
      web_translate_dialog/static/src/js/web_translate_dialog.js
  6. 4
      web_translate_dialog/static/src/xml/base.xml

0
web_translate_dialog_page/__init__.py → web_translate_dialog/__init__.py

33
web_translate_dialog_page/__openerp__.py → web_translate_dialog/__openerp__.py

@ -19,34 +19,27 @@
# #
############################################################################## ##############################################################################
{
"name": "Web Translate Dialog in Page view",
{"name": "Web Translate Dialog",
"category": "Hidden", "category": "Hidden",
"description":
"""
Replace the standard translation dialog by an alternative one:
"description": """
Replace the standard translation view by an alternative one:
* Hide the buttons at right of the fields and instead
* Add a "Translate" button in page view, next to "Edit"
* Add a "Translate" button item in the "More" menu
* 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": [
'web',
"depends": ['web',
], ],
'js': [
'static/src/js/web_translate_dialog_page.js',
'js': ['static/src/js/web_translate_dialog.js',
], ],
'css' : [
'static/src/css/base.css',
'css': ['static/src/css/base.css',
], ],
'qweb' : [
"static/src/xml/base.xml",
'qweb': ["static/src/xml/base.xml",
], ],
'auto_install': False, 'auto_install': False,
}
}

0
web_translate_dialog_page/orm.py → web_translate_dialog/orm.py

0
web_translate_dialog_page/static/src/css/base.css → web_translate_dialog/static/src/css/base.css

10
web_translate_dialog_page/static/src/js/web_translate_dialog_page.js → web_translate_dialog/static/src/js/web_translate_dialog.js

@ -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({
template: "TranslateDialogPage",
instance.web_translate_dialog.TranslateDialog = instance.web.Dialog.extend({
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();

4
web_translate_dialog_page/static/src/xml/base.xml → web_translate_dialog/static/src/xml/base.xml

@ -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…
Cancel
Save