[IMP] website: add debugger template used to create nex tours/tests (display in custo...
authorChristophe Matthieu <chm@openerp.com>
Thu, 6 Feb 2014 13:50:36 +0000 (14:50 +0100)
committerChristophe Matthieu <chm@openerp.com>
Thu, 6 Feb 2014 13:50:36 +0000 (14:50 +0100)
bzr revid: chm@openerp.com-20140206135036-geq8fubtz39pxp20

addons/website/controllers/main.py
addons/website/static/src/js/website.editor.js
addons/website/views/website_templates.xml
addons/website_event_sale/views/website_event_sale.xml
addons/website_sale/views/website_sale.xml

index 0a3f717..a6d8f29 100644 (file)
@@ -179,6 +179,7 @@ class Website(openerp.addons.web.controllers.main.Home):
                     result.append({
                         'name': v.inherit_option_id.name,
                         'id': v.id,
+                        'xml_id': v.xml_id,
                         'inherit_id': v.inherit_id.id,
                         'header': True,
                         'active': False
@@ -187,6 +188,7 @@ class Website(openerp.addons.web.controllers.main.Home):
                 result.append({
                     'name': v.name,
                     'id': v.id,
+                    'xml_id': v.xml_id,
                     'inherit_id': v.inherit_id.id,
                     'header': False,
                     'active': (v.inherit_id.id == v.inherit_option_id.id) or (not optional and v.inherit_id.id)
index e5ba501..e809619 100644 (file)
                 openerp.jsonRpc('/website/customize_template_get', 'call', { 'xml_id': view_name }).then(
                     function(result) {
                         _.each(result, function (item) {
+                            if (item.xml_id === "website.debugger" && !window.location.search.match(/[&?]debug(&|$)/)) return;
                             if (item.header) {
                                 menu.append('<li class="dropdown-header">' + item.name + '</li>');
                             } else {
index 0f77d7e..5684f51 100644 (file)
     </xpath>
 </template>
 
+<template id="debugger" inherit_option_id="website.layout" name="Debugger &amp; Tests">
+    <xpath expr='//t[@name="layout_head"]' position="after">
+        <script type="text/javascript" src="/website/static/src/js/website.tour.test.js"></script>
+    </xpath>
+</template>
+
 <template id="login_layout" inherit_id="web.login_layout" name="Website Login Layout">
     <xpath expr="t" position="replace">
         <t t-call="website.layout">
index aa56a55..c3e0803 100644 (file)
@@ -2,6 +2,13 @@
 <openerp>
 <data>
 
+<template id="debugger" inherit_id="website.debugger" name="Event Debugger">
+    <xpath expr="//script[last()]" position="after">
+        <script type="text/javascript" src="/website_event_sale/static/src/js/website.tour.event_sale.js"></script>
+    </xpath>
+</template>
+
+
 <template id="index" inherit_id="website_event.index" name="Event's Ticket">
     <xpath expr="//li[@t-foreach='event_ids']/div/h4" position="before">
         <t t-if="event.state in ['draft', 'confirm'] and event.event_ticket_ids">
index ed2007e..6608cf0 100644 (file)
@@ -4,6 +4,13 @@
 
 <!-- Layout add nav and footer -->
 
+<template id="debugger" inherit_id="website.debugger" name="Event Debugger">
+    <xpath expr="//script[last()]" position="after">
+        <script type="text/javascript" src="/website_sale/static/src/js/website.tour.sale.customize.js"></script>
+        <script type="text/javascript" src="/website_sale/static/src/js/website.tour.sale.js"></script>
+    </xpath>
+</template>
+
 <template id="editor_head" inherit_id="website.editor_head" name="Shop Editor" groups="base.group_sale_manager">
   <xpath expr="//script[@id='website_tour_js']" position="after">
       <script type="text/javascript" src="/website_sale/static/src/js/website_sale.editor.js"></script>