From c861034d5938f377db620f05d66ea7d064af0ae5 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Thu, 27 Jun 2013 11:14:09 +0200 Subject: [PATCH] page route bzr revid: al@openerp.com-20130627091409-fs171rxp8cmocndk --- addons/website/controllers/main.py | 13 +++++++++++++ addons/website/views/test.xml | 7 +------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index f8f45e44f9d..3835baafc30 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -61,5 +61,18 @@ class Website(openerp.addons.web.controllers.main.Home): def admin(self, *args, **kw): return super(Website, self).index(*args, **kw) + @http.route('/page/', type='http', auth="db") + def index(self, **kw): + editable = bool(request.session._uid) + try: + request.session.check_security() + except http.SessionExpiredException: + editable = False + path = kw['path'] + modules = request.registry.get("ir.ui.view").render(request.cr, 1, path, {}) + if editable: + html = html.replace('', get_html_head()) + return html + # vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/website/views/test.xml b/addons/website/views/test.xml index 1fd4aa7b5ba..3dcd5a1ecd7 100644 --- a/addons/website/views/test.xml +++ b/addons/website/views/test.xml @@ -8,7 +8,7 @@ -
This is the header
+
This is the header
This is the main content