Skip to content
Snippets Groups Projects
Commit 1f964d26 authored by Christophe Matthieu's avatar Christophe Matthieu
Browse files

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

parent 9178dcd3
No related branches found
No related tags found
No related merge requests found
(function () {
$(function () {
'use strict';
var website = openerp.website;
website.snippet.BuildingBlock.include({
_get_snippet_url: function () {
return '/website_mail/snippets';
}
});
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');
// 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();
openerp.website.editor_bar.edit();
event.preventDefault();
});
});
});
})();
}
});
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment