[FIX] website_mail: can't be edit the mail template, javascript must be added into the asset

This commit is contained in:
Christophe Matthieu
2014-09-19 11:47:49 +02:00
parent 9178dcd3f6
commit 1f964d2693
3 changed files with 30 additions and 28 deletions
@@ -1,26 +1,25 @@
(function () {
$(function () {
'use strict';
var website = openerp.website;
website.snippet.BuildingBlock.include({
_get_snippet_url: function () {
return '/website_mail/snippets';
}
});
// Copy the template to the body of the email
$(document).ready(function () {
$('.js_template_set').click(function(ev) {
$('#email_designer').show();
$('#email_template').hide();
$(".js_content", $(this).parent()).children().clone().appendTo('#email_body');
$(".js_content", $(this).parent()).children().clone().appendTo('#email_body_html');
$('#email_body').addClass('oe_dirty');
$('#email_body_html').addClass('oe_dirty');
openerp.website.editor_bar.edit();
event.preventDefault();
if ($("#email_designer").length) {
openerp.website.snippet.BuildingBlock.include({
_get_snippet_url: function () {
return '/website_mail/snippets';
}
});
});
})();
// Copy the template to the body of the email
$(document).ready(function () {
$('.js_template_set').click(function(ev) {
$('#email_designer').show();
$('#email_template').hide();
$(".js_content", $(this).parent()).children().clone().appendTo('#email_body');
$(".js_content", $(this).parent()).children().clone().appendTo('#email_body_html');
$('#email_body').addClass('oe_dirty');
$('#email_body_html').addClass('oe_dirty');
openerp.website.editor_bar.edit();
event.preventDefault();
});
});
}
});
+2 -2
View File
@@ -10,7 +10,7 @@
</ul>
<div class="tab-content">
<div id="snippet_email_structure" class="tab-pane fade in active">
<div id="snippet_email_structure" class="tab-pane in active">
<div>
@@ -259,7 +259,7 @@
</div>
<div id="snippet_email_feature" class="tab-pane fade">
<div id="snippet_email_feature" class="tab-pane">
<div>
@@ -2,12 +2,15 @@
<openerp>
<data>
<template id="assets_editor" inherit_id="website.assets_editor" name="Email Designer">
<xpath expr="." position="inside">
<script type="text/javascript" src="/website_mail/static/src/js/website_email_designer.js"></script>
</xpath>
</template>
<!-- Template Choice page -->
<template id="email_designer" name="Email Designer">
<t t-call="website.layout">
<t t-set="head">
<script type="text/javascript" src="/website_mail/static/src/js/website_email_designer.js"></script>
</t>
<div id="wrap" class="container" t-ignore="True">
<div id="email_template" class="mb32" t-att-style="mode != 'email_template' and 'display: none' or ''">
<a class="mt16 btn btn-default pull-right"