1 # -*- coding: utf-8 -*-
2 import web.common.http as openerpweb
4 WIDGET_CONTENT_PATTERN = """<!DOCTYPE html>
6 <head><title>[[Widget %(id)d]]</title></head>
9 <script type="text/javascript">
10 var load = window.onload;
11 window.onload = function () {
15 window.frameElement.style.height = document.height + 'px';
21 class Widgets(openerpweb.Controller):
22 _cp_path = '/web_dashboard/widgets'
24 @openerpweb.httprequest
25 def content(self, request, widget_id):
26 return WIDGET_CONTENT_PATTERN % request.session.model('res.widget').read(
27 [int(widget_id)], ['content'], request.session.eval_context(request.context)