[FIX] website, mass_mailing: restore original FieldTextHtml widget -> FieldTextHtmlFrame only for mass_mailing

The new `summernote in iframe` version of the
FieldTextHtml widget is not ready for prime time
yet.
Usability is not very good when used as a replacement
for the previous html editor, especially in email
composer windows, and initial loading is very slow.

For now we only enable it as FieldTextHtmlFrame for
mass_mailing templates, where isolation of the
style is important (so that recipients receive the
exact same result as was displayed on screen, without
side-effects caused by backend/frontend style)

In master the summernote version will be improved
and the old CLE version will be dropped completely.
This commit is contained in:
Olivier Dony
2015-03-13 13:44:06 +01:00
parent e93ead9093
commit 7eec97a584
5 changed files with 11 additions and 10 deletions
+1 -1
View File
@@ -30,7 +30,7 @@
</group>
<notebook>
<page string="Body">
<field name="body_html" nolabel="1" options="{'editor_url': '/website_mail/field/email_template'}"/>
<field name="body_html" nolabel="1" options="{'editor_url': '/website_mail/field/email_template'}" widget="html_frame"/>
<field name="attachment_ids" widget="many2many_binary"/>
</page>
</notebook>
+2 -2
View File
@@ -261,7 +261,7 @@
</div>
<notebook>
<page string="Popup Content">
<field name="popup_content" options="{'editor_url': '/website_mass_mailing/field/popup_content'}"/>
<field name="popup_content" options="{'editor_url': '/website_mass_mailing/field/popup_content'}" widget="html_frame"/>
</page>
</notebook>
</sheet>
@@ -443,7 +443,7 @@
</group>
<notebook>
<page string="Mail Body">
<field name="body_html" options="{'editor_url': '/website_mail/field/email_template'}"/>
<field name="body_html" options="{'editor_url': '/website_mail/field/email_template'}" widget="html_frame"/>
<field name="attachment_ids" widget="many2many_binary" string="Attach a file"/>
</page>
<page string="Options">
@@ -4,7 +4,7 @@
.oe_WidgetWebsiteButton.success .oe_unpublish {
display: none;
}
.oe_form_field_html iframe {
.oe_form_field_html_frame iframe {
display: block;
width: 100%;
border: 0;
@@ -12,7 +12,7 @@
margin: 0;
min-height: 300px;
}
.o_form_FieldTextHtml_fullscreen .oe_form_field_html iframe {
.o_form_FieldTextHtml_fullscreen .oe_form_field_html_frame iframe {
position: absolute !important;
left: 0 !important;
right: 0 !important;
@@ -22,7 +22,7 @@
z-index: 1001 !important;
border: 0;
}
.o_form_FieldTextHtml_fullscreen .modal .oe_form_field_html iframe {
.o_form_FieldTextHtml_fullscreen .modal .oe_form_field_html_frame iframe {
top: 0 !important;
}
.o_form_FieldTextHtml_fullscreen .oe_webclient *, .o_form_FieldTextHtml_fullscreen .modal * {
@@ -15,11 +15,12 @@ instance.web.form.WidgetWebsiteButton = instance.web.form.AbstractField.extend({
});
instance.web.form.widgets = instance.web.form.widgets.extend({
'website_button': 'instance.web.form.WidgetWebsiteButton',
'html_frame': 'instance.web.form.FieldTextHtmlFrame',
});
var widget = instance.web.form.AbstractField.extend(instance.web.form.ReinitializeFieldMixin);
instance.web.form.FieldTextHtml = widget.extend({
template: 'FieldTextHtml',
instance.web.form.FieldTextHtmlFrame = widget.extend({
template: 'FieldTextHtmlFrame',
start: function () {
var self = this;
@@ -8,8 +8,8 @@
</div>
</t>
<t t-name="FieldTextHtml">
<div class="oe_form_field oe_form_field_html oe_form_embedded_html" t-att-style="widget.node.attrs.style">
<t t-name="FieldTextHtmlFrame">
<div class="oe_form_field oe_form_field_html_frame oe_form_embedded_html" t-att-style="widget.node.attrs.style">
<iframe/>
</div>
</t>