summaryrefslogtreecommitdiff
path: root/addons/base_dashboard/controllers.py
diff options
context:
space:
mode:
authorniv-openerp <nicolas.vanhoren@openerp.com>2011-08-25 19:16:12 +0200
committerniv-openerp <nicolas.vanhoren@openerp.com>2011-08-25 19:16:12 +0200
commitde1fc9e3c5f3d05eb99b60342bda4f8d4dc23e5b (patch)
tree911d33c9d2ad8ebba4331013d5f7261d7f97a023 /addons/base_dashboard/controllers.py
parent27eff948b572090192c837c4afb37c796286ebf2 (diff)
parent238a0200a0cf67f9bf167b48c77ec1037b5da761 (diff)
[merge]
bzr revid: nicolas.vanhoren@openerp.com-20110825171612-ieb6ggnm5wugb50y
Diffstat (limited to 'addons/base_dashboard/controllers.py')
-rw-r--r--addons/base_dashboard/controllers.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/addons/base_dashboard/controllers.py b/addons/base_dashboard/controllers.py
index d24649a21cc..b0f5fbf817e 100644
--- a/addons/base_dashboard/controllers.py
+++ b/addons/base_dashboard/controllers.py
@@ -1,11 +1,28 @@
# -*- coding: utf-8 -*-
import openerpweb
+WIDGET_CONTENT_PATTERN = """<!DOCTYPE html>
+<html>
+ <head><title>[[Widget %(id)d]]</title></head>
+ <body>
+ %(content)s
+ <script type="text/javascript">
+ var load = window.onload;
+ window.onload = function () {
+ if (load) {
+ load();
+ }
+ window.frameElement.style.height = document.height + 'px';
+ }
+ </script>
+ </body>
+</html>
+"""
class Widgets(openerpweb.openerpweb.Controller):
_cp_path = '/base_dashboard/widgets'
@openerpweb.httprequest
def content(self, request, widget_id):
- return request.session.model('res.widget').read(
+ return WIDGET_CONTENT_PATTERN % request.session.model('res.widget').read(
[widget_id], ['content'], request.session.eval_context(request.context)
- )[0]['content']
+ )[0]