page route

bzr revid: al@openerp.com-20130627091409-fs171rxp8cmocndk
This commit is contained in:
Antony Lesuisse
2013-06-27 11:14:09 +02:00
parent cdeba13394
commit c861034d59
2 changed files with 14 additions and 6 deletions
+13
View File
@@ -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/<path:path>', 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('<!--editable-->', get_html_head())
return html
# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4:
+1 -6
View File
@@ -8,7 +8,7 @@
<field name="arch" type="xml">
<html>
<body>
<header>This is the header</header>
<header>This is the header <t t-esc="1+1"/></header>
<div class="main">This is the main content</div>
<nav>
<ul class="menu_list">
@@ -33,10 +33,5 @@
</field>
</record>
<menuitem name="Test views"
id="base.menu_test_view"
parent="base.menu_config"
sequence="80"/>
</data>
</openerp>