page route
authorAntony Lesuisse <al@openerp.com>
Thu, 27 Jun 2013 09:14:09 +0000 (11:14 +0200)
committerAntony Lesuisse <al@openerp.com>
Thu, 27 Jun 2013 09:14:09 +0000 (11:14 +0200)
bzr revid: al@openerp.com-20130627091409-fs171rxp8cmocndk

addons/website/controllers/main.py
addons/website/views/test.xml

index f8f45e4..3835baa 100644 (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:
index 1fd4aa7..3dcd5a1 100644 (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">
             </field>
         </record>
 
-        <menuitem name="Test views"
-            id="base.menu_test_view"
-            parent="base.menu_config"
-            sequence="80"/>
-
      </data>
 </openerp>