[IMP] website: add debugger template used to create nex tours/tests (display in customize menu in debug mode)

bzr revid: chm@openerp.com-20140206135036-geq8fubtz39pxp20
This commit is contained in:
Christophe Matthieu 2014-02-06 14:50:36 +01:00
parent 1e4d99eede
commit d819d494f1
5 changed files with 23 additions and 0 deletions

View 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)

View File

@ -414,6 +414,7 @@
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 {

View File

@ -284,6 +284,12 @@
</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">

View 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">

View 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>