Skip to content

Commit 23711a1

Browse files
make o_editable work + /field command + start fixing nbsp in templates
1 parent 819f60a commit 23711a1

File tree

4 files changed

+37
-22
lines changed

4 files changed

+37
-22
lines changed

addons/html_builder/static/src/core/setup_editor_plugin.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export class SetupEditorPlugin extends Plugin {
88
resources = {
99
clean_for_save_handlers: this.cleanForSave.bind(this),
1010
normalize_handlers: withSequence(0, this.setContenteditable.bind(this)),
11+
o_editable_selectors: "[data-oe-model]",
1112
};
1213

1314
setup() {
@@ -20,7 +21,9 @@ export class SetupEditorPlugin extends Plugin {
2021
return;
2122
}
2223
// Add the `o_editable` class on the editable elements
23-
let editableEls = this.getEditableElements("[data-oe-model]")
24+
let editableEls = this.getEditableElements(
25+
this.getResource("o_editable_selectors").join(", ")
26+
)
2427
.filter((el) => !el.matches("link, script"))
2528
.filter((el) => !el.hasAttribute("data-oe-readonly"))
2629
.filter(
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Plugin } from "@html_editor/plugin";
2+
import { registry } from "@web/core/registry";
3+
4+
export class MassMailingSetupPlugin extends Plugin {
5+
static id = "mass_mailing_setup_plugin";
6+
resources = {
7+
o_editable_selectors: ".o_mail_wrapper_td",
8+
};
9+
}
10+
11+
registry.category("mass_mailing-plugins").add(MassMailingSetupPlugin.id, MassMailingSetupPlugin);

addons/mass_mailing_egg/static/src/themes/theme_wrapper.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
<t t-name="mass_mailing_egg.ThemeWrapper">
1111
<div class="container o_mail_wrapper o_mail_regular oe_unremovable">
1212
<div class="row">
13-
<!-- TODO data-oe-model guarantees that o_editable class is added, this is bullshit -->
14-
<div class="col o_mail_no_options o_mail_wrapper_td bg-white oe_structure" data-oe-model="" t-out="html"/>
13+
<!-- TODO EGGMAIL to investigate if correct, but o_mail_wrapper will be responsible for the addition
14+
of o_editable, which is necessary in `setup_editor_plugin` -->
15+
<div class="col o_mail_no_options o_mail_wrapper_td bg-white oe_structure" t-out="html"/>
1516
</div>
1617
</div>
1718
</t>

addons/mass_mailing_themes/views/mass_mailing_themes_templates.xml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
<span class="fa fa-linkedin text-white" style="background-color: rgb(43, 59, 88) !important;"/>
6767
</a>&amp;nbsp;&amp;nbsp;
6868
<a style="margin-left:10px" title="X" href="https://twitter.com/Odoo">
69-
<span class="fa fa-twitter text-white" style="background-color: rgb(43, 59, 88) !important;"/>
69+
<span class="fa fa-twitter text-white" style="background-color: rgb(43, 59, 88) !important;"/>
7070
</a>&amp;nbsp;&amp;nbsp;
7171
<a style="margin-left:10px" title="Instagram" href="https://www.instagram.com/explore/tags/odoo/">
7272
<span class="fa fa-instagram text-white" style="background-color: rgb(43, 59, 88) !important;"/>
@@ -215,15 +215,15 @@
215215
</div>
216216
<div class="col-lg-8 o_mail_header_social" style="text-align:right;">
217217
<a title="Facebook" href="https://www.facebook.com/Odoo">
218-
<span class="fa fa-facebook" style="color: rgb(54, 166, 210) !important; font-size: 18px;"/>
218+
<span class="fa fa-facebook" style="color: rgb(54, 166, 210) !important; font-size: 18px;"/>
219219
</a>
220220
&amp;nbsp; &amp;nbsp;
221221
<a style="margin-left:10px" title="LinkedIn" href="https://www.linkedin.com/company/odoo">
222-
<span class="fa fa-linkedin" style="color: rgb(54, 166, 210) !important; font-size: 18px;"/>
222+
<span class="fa fa-linkedin" style="color: rgb(54, 166, 210) !important; font-size: 18px;"/>
223223
</a>
224224
&amp;nbsp; &amp;nbsp;
225225
<a style="margin-left:10px" title="X" href="https://twitter.com/Odoo">
226-
<span class="fa fa-twitter" style="color: rgb(54, 166, 210) !important; font-size: 18px;"/>
226+
<span class="fa fa-twitter" style="color: rgb(54, 166, 210) !important; font-size: 18px;"/>
227227
</a>
228228
&amp;nbsp; &amp;nbsp;
229229
<a style="margin-left:10px" title="Instagram" href="https://www.instagram.com/explore/tags/odoo/">
@@ -421,7 +421,7 @@
421421
<p style="text-align: center; color: white;">Here's your coupon code*:</p>
422422
<table border="0" cellpadding="0" cellspacing="0" align="center" class="border" style="background-color: rgb(36, 37, 48) !important; border-collapse: collapse; border-color: rgb(198, 150, 120) !important;">
423423
<tr>
424-
<td width="50" height="50" align="center" class="o_mail_no_resize" style="min-width: 50px; max-width: 5.6rem; width: 50px !important; background-color: rgb(198, 150, 120) !important; text-align: center;"><i class="fa fa-2x fa-ticket" style="color: rgb(36, 37, 48) !important;"/></td>
424+
<td width="50" height="50" align="center" class="o_mail_no_resize" style="min-width: 50px; max-width: 5.6rem; width: 50px !important; background-color: rgb(198, 150, 120) !important; text-align: center;"><i class="fa fa-2x fa-ticket" style="color: rgb(36, 37, 48) !important;"/></td>
425425
<td width="200" height="50" align="center" style="min-width: 150px; width: 200px;"><p class="mb0"><span style="font-weight: bolder; color: white;">VIP10</span></p></td>
426426
</tr>
427427
</table>
@@ -745,19 +745,19 @@
745745
<div class="row">
746746
<div class="col-lg-12" style="text-align: center;" t-translation="off">
747747
<a aria-label="Facebook" title="Facebook" href="https://www.facebook.com/Odoo">
748-
<span class="fa fa-facebook" style="color: rgb(186, 0, 19) !important;"/>
748+
<span class="fa fa-facebook" style="color: rgb(186, 0, 19) !important;"/>
749749
</a>&amp;nbsp;&amp;nbsp;
750750
<a style="margin-left:10px" aria-label="LinkedIn" title="LinkedIn" href="https://www.linkedin.com/company/odoo">
751-
<span class="fa fa-linkedin" style="color: rgb(186, 0, 19) !important;"/>
751+
<span class="fa fa-linkedin" style="color: rgb(186, 0, 19) !important;"/>
752752
</a>&amp;nbsp;&amp;nbsp;
753753
<a style="margin-left:10px" aria-label="X" title="X" href="https://twitter.com/Odoo">
754-
<span class="fa fa-twitter" style="color: rgb(186, 0, 19) !important;"/>
754+
<span class="fa fa-twitter" style="color: rgb(186, 0, 19) !important;"/>
755755
</a>&amp;nbsp;&amp;nbsp;
756756
<a style="margin-left:10px" aria-label="Instagram" title="Instagram" href="https://www.instagram.com/explore/tags/odoo/">
757-
<span class="fa fa-instagram" style="color: rgb(186, 0, 19) !important;"/>
757+
<span class="fa fa-instagram" style="color: rgb(186, 0, 19) !important;"/>
758758
</a>&amp;nbsp;&amp;nbsp;
759759
<a style="margin-left:10px" aria-label="TikTok" title="TikTok" href="https://www.tiktok.com/@odoo">
760-
<span class="fa fa-tiktok" style="color: rgb(186, 0, 19) !important;"/>
760+
<span class="fa fa-tiktok" style="color: rgb(186, 0, 19) !important;"/>
761761
</a>
762762
</div>
763763
</div>
@@ -892,7 +892,7 @@
892892
<span class="fa fa-linkedin bg-black" style="color: rgb(255, 187, 0) !important;"/>
893893
</a>&amp;nbsp;&amp;nbsp;
894894
<a style="margin-left:10px" aria-label="X" title="X" href="https://twitter.com/Odoo">
895-
<span class="fa fa-twitter bg-black" style="color: rgb(255, 187, 0) !important;"/>
895+
<span class="fa fa-twitter bg-black" style="color: rgb(255, 187, 0) !important;"/>
896896
</a>&amp;nbsp;&amp;nbsp;
897897
<a aria-label="Instagram" title="Instagram" href="https://www.instagram.com/explore/tags/odoo/">
898898
<span class="fa fa-instagram bg-black" style="color: rgb(255, 187, 0) !important;"/>
@@ -956,13 +956,13 @@
956956
</div>
957957
<div class="col-lg-4 o_mail_header_social" style="text-align: right">
958958
<a aria-label="Facebook" title="Facebook" target="_blank" href="https://www.facebook.com/Odoo">
959-
<span class="fa fa-facebook" style="color: rgb(84, 52, 39) !important; background-color: rgb(211, 197, 177) !important;"></span>
959+
<span class="fa fa-facebook" style="color: rgb(84, 52, 39) !important; background-color: rgb(211, 197, 177) !important;"></span>
960960
</a>&amp;nbsp;&amp;nbsp;
961961
<a style="margin-left:10px" aria-label="X" title="X" target="_blank" href="https://twitter.com/Odoo">
962-
<span class="fa fa-twitter" style="color: rgb(84, 52, 39) !important; background-color: rgb(211, 197, 177) !important;"></span>
962+
<span class="fa fa-twitter" style="color: rgb(84, 52, 39) !important; background-color: rgb(211, 197, 177) !important;"></span>
963963
</a>&amp;nbsp;&amp;nbsp;
964964
<a style="margin-left:10px" aria-label="Instagram" title="Instagram" target="_blank" href="https://www.instagram.com/explore/tags/odoo/" contenteditable="true">
965-
<span class="fa fa-instagram" style="color: rgb(84, 52, 39) !important; background-color: rgb(211, 197, 177) !important;"></span>
965+
<span class="fa fa-instagram" style="color: rgb(84, 52, 39) !important; background-color: rgb(211, 197, 177) !important;"></span>
966966
</a>
967967
</div>
968968
</div>
@@ -1569,7 +1569,7 @@
15691569
</div>
15701570
</div>
15711571
<p><span style="font-weight: bolder;">25 September 2022 - 4:30 PM</span></p>
1572-
<p><i class="fa fa-map-marker"/> London, United Kingdom</p>
1572+
<p><i class="fa fa-map-marker"/> London, United Kingdom</p>
15731573
</div>
15741574
</div>
15751575
</div>
@@ -1621,16 +1621,16 @@
16211621
<div class="row">
16221622
<div class="col-lg o_mail_footer_social pt8 pb8">
16231623
<a aria-label="Facebook" title="Facebook" href="https://www.facebook.com/Odoo">
1624-
<span class="fa fa-facebook" contenteditable="false"></span>
1624+
<span class="fa fa-facebook" contenteditable="false"></span>
16251625
</a>
16261626
<a style="margin-left:10px" aria-label="LinkedIn" title="LinkedIn" href="https://www.linkedin.com/company/odoo">
1627-
<span class="fa fa-linkedin" contenteditable="false"></span>
1627+
<span class="fa fa-linkedin" contenteditable="false"></span>
16281628
</a>
16291629
<a style="margin-left:10px" aria-label="X" title="X" href="https://twitter.com/Odoo">
1630-
<span class="fa fa-twitter" contenteditable="false"></span>
1630+
<span class="fa fa-twitter" contenteditable="false"></span>
16311631
</a>
16321632
<a style="margin-left:10px" aria-label="Instagram" title="Instagram" href="https://www.instagram.com/explore/tags/odoo/">
1633-
<span class="fa fa-instagram" contenteditable="false"></span>
1633+
<span class="fa fa-instagram" contenteditable="false"></span>
16341634
</a>
16351635
</div>
16361636
</div>

0 commit comments

Comments
 (0)