From 7d22e1eb8cf4058b923300e8e85c0375696460a2 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Mon, 23 Jan 2012 00:32:02 +0100 Subject: [PATCH] [FIX] revert html_template is used by other modules. commit 2012 revid:nicolas.vanhoren@openerp.com-20120118161735-2yuxisndfq92ctoi bzr revid: al@openerp.com-20120122233202-moq81q35qddjtlw8 --- Makefile | 3 +++ addons/web/controllers/main.html | 21 --------------------- addons/web/controllers/main.py | 22 +++++++++++++++++++--- addons/web/static/src/js/chrome.js | 1 + 4 files changed, 23 insertions(+), 24 deletions(-) delete mode 100644 addons/web/controllers/main.html diff --git a/Makefile b/Makefile index 9e84e356aaf..4beb20d3eed 100644 --- a/Makefile +++ b/Makefile @@ -29,3 +29,6 @@ doc: cloc: cloc addons/*/common/*.py addons/*/controllers/*.py addons/*/static/src/*.js addons/*/static/src/js/*.js addons/*/static/src/css/*.css addons/*/static/src/xml/*.xml +blamestat: + echo addons/*/common/*.py addons/*/controllers/*.py addons/*/static/src/js/*.js addons/*/static/src/css/*.css addons/*/static/src/xml/*.xml | xargs -t -n 1 bzr blame -v --long --all | awk '{print $2}' | sort | uniq -c | sort -n + diff --git a/addons/web/controllers/main.html b/addons/web/controllers/main.html deleted file mode 100644 index fd0be5ba349..00000000000 --- a/addons/web/controllers/main.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - OpenERP - - %(css)s - %(js)s - - - - - - \ No newline at end of file diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 7f5b43ba671..7844897c047 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -84,9 +84,24 @@ def concat_files(file_list, reader=None, intersperse=""): files_concat = intersperse.join(files_content) return files_concat,files_timestamp -html_template = None -with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "main.html")) as html_file: - html_template = html_file.read() +html_template = """ + + + + OpenERP + + %(css)s + %(js)s + + + + +""" class WebClient(openerpweb.Controller): _cp_path = "/web/webclient" @@ -192,6 +207,7 @@ class WebClient(openerpweb.Controller): 'js': js, 'css': css, 'modules': simplejson.dumps(self.server_wide_modules(req)), + 'init': 'new s.web.WebClient().start();', } return r diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 06fcf518002..b8ee62c3749 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1061,6 +1061,7 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie }, start: function() { var self = this; + this.$element = $(document.body); if (jQuery.param != undefined && jQuery.deparam(jQuery.param.querystring()).kitten != undefined) { this.$element.addClass("kitten-mode-activated"); this.$element.delegate('img.oe-record-edit-link-img', 'hover', function(e) {