diff --git a/addons/mass_mailing/__openerp__.py b/addons/mass_mailing/__openerp__.py index 1f3d4da7dde..0d9a32c20db 100644 --- a/addons/mass_mailing/__openerp__.py +++ b/addons/mass_mailing/__openerp__.py @@ -17,7 +17,6 @@ professional emails and reuse templates in a few clicks. 'mail', 'marketing', 'web_kanban_gauge', - 'website_mail', 'website_links', 'utm', ], @@ -31,10 +30,22 @@ professional emails and reuse templates in a few clicks. 'views/res_config.xml', 'views/email_template.xml', 'views/website_mass_mailing.xml', - 'views/snippets.xml', 'security/ir.model.access.csv', 'views/mass_mailing.xml', 'views/unsubscribe.xml', + 'views/snippets.xml', + 'views/editor_field_html.xml', + 'views/snippets_themes.xml', + 'views/snippets_themes_options.xml', + 'views/theme_list.xml', + 'views/theme/neopolitan_snippets.xml', + 'views/theme/skyline_snippets.xml', + 'views/theme/narrative_snippets.xml', + 'views/theme/sunday_snippets.xml', + 'views/theme/go_snippets.xml', + 'views/theme/airmail_snippets.xml', + 'views/theme/zenflat_snippets.xml', + 'views/theme/cleave_snippets.xml', ], 'qweb': [], 'demo': [ diff --git a/addons/mass_mailing/controllers/__init__.py b/addons/mass_mailing/controllers/__init__.py index fa333707c98..998faae89f3 100644 --- a/addons/mass_mailing/controllers/__init__.py +++ b/addons/mass_mailing/controllers/__init__.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- import main -import website +import web_editor diff --git a/addons/mass_mailing/controllers/main.py b/addons/mass_mailing/controllers/main.py index d1e3b5a7657..2a86ceaaef6 100644 --- a/addons/mass_mailing/controllers/main.py +++ b/addons/mass_mailing/controllers/main.py @@ -19,7 +19,7 @@ class MassMailController(http.Controller): return response - @http.route(['/mail/mailing//unsubscribe'], type='http', auth='none', website=True) + @http.route(['/mail/mailing//unsubscribe'], type='http', website=True, auth='none') def mailing(self, mailing_id, email=None, res_id=None, **post): mailing = request.env['mail.mass_mailing'].sudo().browse(mailing_id) if mailing.exists(): @@ -30,14 +30,14 @@ class MassMailController(http.Controller): mailing.update_opt_out(mailing_id, email, [res_id], True) return request.website.render('mass_mailing.page_unsubscribed') - @http.route(['/mail/mailing/unsubscribe'], type='json', auth='none', website=True) + @http.route(['/mail/mailing/unsubscribe'], type='json', auth='none') def unsubscribe(self, mailing_id, opt_in_ids, opt_out_ids, email): mailing = request.env['mail.mass_mailing'].sudo().browse(mailing_id) if mailing.exists(): mailing.update_opt_out(mailing_id, email, opt_in_ids, False) mailing.update_opt_out(mailing_id, email, opt_out_ids, True) - @http.route('/website_mass_mailing/is_subscriber', type='json', auth="public", website=True) + @http.route('/website_mass_mailing/is_subscriber', type='json', website=True, auth="public") def is_subscriber(self, list_id, **post): cr, uid, context = request.cr, request.uid, request.context Contacts = request.registry['mail.mass_mailing.contact'] @@ -56,7 +56,7 @@ class MassMailController(http.Controller): return {'is_subscriber': is_subscriber, 'email': email} - @http.route('/website_mass_mailing/subscribe', type='json', auth="public", website=True) + @http.route('/website_mass_mailing/subscribe', type='json', auth="public") def subscribe(self, list_id, email, **post): cr, uid, context = request.cr, request.uid, request.context Contacts = request.registry['mail.mass_mailing.contact'] @@ -77,7 +77,7 @@ class MassMailController(http.Controller): request.registry['website.links.click'].add_click(cr, uid, code, request.httprequest.remote_addr, request.session['geoip'].get('country_code'), stat_id=stat_id, context=context) return werkzeug.utils.redirect(request.registry['website.links'].get_url_from_code(cr, uid, code, context=context), 301) - @http.route(['/website_mass_mailing/get_content'], type='json', auth="public", website=True) + @http.route(['/website_mass_mailing/get_content'], type='json', auth="public") def get_mass_mailing_content(self, newsletter_id, **post): data = self.is_subscriber(newsletter_id, **post) mass_mailing_list = request.registry['mail.mass_mailing.list'].browse(request.cr, SUPERUSER_ID, int(newsletter_id), request.context) diff --git a/addons/mass_mailing/controllers/web_editor.py b/addons/mass_mailing/controllers/web_editor.py new file mode 100644 index 00000000000..f8e3007a5ac --- /dev/null +++ b/addons/mass_mailing/controllers/web_editor.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- + +from openerp import http +from openerp.http import request +from openerp.addons.web_editor.controllers.main import Web_Editor + + +class Web_Editor(Web_Editor): + + @http.route(["/website_mass_mailing/field/popup_content"], type='http', auth="user") + def mass_mailing_FieldTextHtmlPopupTemplate(self, model=None, res_id=None, field=None, callback=None, **kwargs): + kwargs['snippets'] = '/website/snippets' + kwargs['template'] = 'mass_mailing.FieldTextHtmlPopupContent' + return self.FieldTextHtml(model, res_id, field, callback, **kwargs) + + @http.route('/mass_mailing/field/email_template', type='http', auth="user") + def mass_mailing_FieldTextHtmlEmailTemplate(self, model=None, res_id=None, field=None, callback=None, **kwargs): + kwargs['snippets'] = '/mass_mailing/snippets' + kwargs['template'] = 'mass_mailing.FieldTextHtmlInline' + return self.FieldTextHtmlInline(model, res_id, field, callback, **kwargs) + + @http.route(['/mass_mailing/snippets'], type='json', auth="user", website=True) + def mass_mailing_snippets(self): + return request.registry["ir.ui.view"].render(request.cr, request.uid, 'mass_mailing.email_designer_snippets', None, context=request.context) diff --git a/addons/mass_mailing/controllers/website.py b/addons/mass_mailing/controllers/website.py deleted file mode 100644 index 4222128535b..00000000000 --- a/addons/mass_mailing/controllers/website.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- - -from openerp import http -from openerp.addons.website.controllers.main import Website - - -class Website(Website): - - @http.route(["/website_mass_mailing/field/popup_content"], type='http', auth="public", website=True) - def FieldTextHtmlPopupTemplate(self, model=None, res_id=None, field=None, callback=None, **kwargs): - kwargs['snippets'] = 'snippets' not in kwargs and '/website/snippets' or kwargs['snippets'] - kwargs['dont_load_assets'] = False - kwargs['template'] = "mass_mailing.FieldTextHtmlPopupContent" - return self.FieldTextHtml(model, res_id, field, callback, **kwargs) diff --git a/addons/mass_mailing/data/mass_mailing_demo.xml b/addons/mass_mailing/data/mass_mailing_demo.xml index 1c76d41ebcd..f58d9dc0f21 100644 --- a/addons/mass_mailing/data/mass_mailing_demo.xml +++ b/addons/mass_mailing/data/mass_mailing_demo.xml @@ -39,40 +39,9 @@ - -
- - -
- -

A Punchy Headline

-
- -
- -
image
- -
- - -
- -

A Small Subtitle for ${object.name}

-
Choose a vibrant image and write an inspiring paragraph about it. It does not have to be long, but it should reinforce your image.
- -
- - - - - -
column2 imageFeature One - -

Choose a vibrant image and write an inspiring paragraph about it. It does not have to be long, but it should reinforce your image.

-
column3 imageFeature Two -

Choose a vibrant image and write an inspiring paragraph about it. It does not have to be long, but it should reinforce your image.

-
-]]>
+ +
Your Company

You get a 20% discount for signing up!

Discount Code: 45A9E77DGW8455

Dear John

Great stories have personality. Consider telling a great story that provides personality. Writing a story with personality for potential clients will assist with making a relationship connection. This shows up in small quirks like word choices or phrases. Write from your point of view, not from someone else's experience.

Great stories are for everyone even when only written for just one person. If you try to write with a wide general audience in mind, your story will ring false and be bland. No one will be interested. Write for one person. If it’s genuine for the one, it’s genuine for the rest.

Kind Regards,

Michael Fletcher

Step 1:

Place Order

Step 2:

Shipping

Step 3:

Payment

]]>
@@ -98,44 +67,9 @@ [('customer', '=', True)] email ]]> - -
- - -
- -

A Punchy Headline

-
- -
- -
image
- -
- - - - -
- -

A Small Subtitle for ${object.name}

-
Choose a vibrant image and write an inspiring paragraph about it. It does not have to be long, but it should reinforce your image.
- -
- - - - - - - -
column2 imageFeature One - -

Choose a vibrant image and write an inspiring paragraph about it. It does not have to be long, but it should reinforce your image.

-
column3 imageFeature Two -

Choose a vibrant image and write an inspiring paragraph about it. It does not have to be long, but it should reinforce your image.

-
-]]>
+ +
Your Company

You get a 20% discount for signing up!

Discount Code: 45A9E77DGW8455

Dear John

Great stories have personality. Consider telling a great story that provides personality. Writing a story with personality for potential clients will assist with making a relationship connection. This shows up in small quirks like word choices or phrases. Write from your point of view, not from someone else's experience.

Great stories are for everyone even when only written for just one person. If you try to write with a wide general audience in mind, your story will ring false and be bland. No one will be interested. Write for one person. If it’s genuine for the one, it’s genuine for the rest.

Kind Regards,

Michael Fletcher

Step 1:

Place Order

Step 2:

Shipping

Step 3:

Payment

]]>
diff --git a/addons/mass_mailing/models/mass_mailing.py b/addons/mass_mailing/models/mass_mailing.py index 8869092d302..2fe192b5ea3 100644 --- a/addons/mass_mailing/models/mass_mailing.py +++ b/addons/mass_mailing/models/mass_mailing.py @@ -479,7 +479,7 @@ class MassMailing(osv.Model): 'create_date': fields.datetime('Creation Date'), 'sent_date': fields.datetime('Sent Date', oldname='date', copy=False), 'schedule_date': fields.datetime('Schedule in the Future'), - 'body_html': fields.html('Body'), + 'body_html': fields.html('Body', translate=True), 'attachment_ids': fields.many2many( 'ir.attachment', 'mass_mailing_ir_attachments_rel', 'mass_mailing_id', 'attachment_id', 'Attachments' diff --git a/addons/website_mail/static/src/css/website_mail_iframe.css b/addons/mass_mailing/static/src/css/mass_mailing_editor.css similarity index 67% rename from addons/website_mail/static/src/css/website_mail_iframe.css rename to addons/mass_mailing/static/src/css/mass_mailing_editor.css index 6e8d6541c95..e2efcf87efa 100644 --- a/addons/website_mail/static/src/css/website_mail_iframe.css +++ b/addons/mass_mailing/static/src/css/mass_mailing_editor.css @@ -1,55 +1,3 @@ -body { - background-color: #fff; -} -p { - margin: initial; -} -a { - color: inherit; -} -a:hover { - color: inherit; -} -#wrapwrap .o_editable { - font: initial; - line-height: initial; - color: initial; -} -#oe_snippets ~ #wrapwrap .o_editable { - margin-bottom: 100px; -} - -#wrapwrap > main > div:first-child { - max-width: 600px; - margin-left: auto; - margin-right: auto; - position: relative; -} - -.editor_enable #wrapwrap > main > div:first-child:before, #wrapwrap > main > div:first-child:after { - content: " "; - display: block; - height: 100%; - position: fixed; - top: -4px; - width: 0; - overflow: hidden; -} -.editor_enable #wrapwrap > main > div:first-child:before { - border-right: 1px dashed #ccc; - margin-left: -5px; -} -.editor_enable #wrapwrap > main > div:first-child:after { - border-left: 1px dashed #ccc; - margin-left: 605px; -} - -.note-color-palette .colorpicker { - display: none; -} - -/***************************/ - #email_theme_list, #email_template_list { clear: both; text-align: center; @@ -128,17 +76,21 @@ a:hover { /***************************/ #templates{ + margin-top: 50px; width: 98%; } #choose_template{ display: none; margin: 5px; - padding: 1px 5px; position: fixed; top: 0; - right: 50px; + right: 28px; z-index: 2000; } +#choose_template span{ + padding: 1px 5px; + height: 24px; +} #templates .template_preview_border{ overflow: hidden !important; border: 2px solid grey; @@ -161,4 +113,4 @@ a:hover { } .theme_thumbnail:hover>.template_preview{ opacity:0.3; -} \ No newline at end of file +} diff --git a/addons/website_mail/static/src/css/snippets.css b/addons/mass_mailing/static/src/css/mass_mailing_editor_thumb.css similarity index 59% rename from addons/website_mail/static/src/css/snippets.css rename to addons/mass_mailing/static/src/css/mass_mailing_editor_thumb.css index c6e3ce1716f..f3e6a40454f 100644 --- a/addons/website_mail/static/src/css/snippets.css +++ b/addons/mass_mailing/static/src/css/mass_mailing_editor_thumb.css @@ -1,85 +1,85 @@ /* ---- thumbnail ---- */ .oe_snippet.o_mail_block_header_center_logo .oe_snippet_thumbnail_img { - background-image: url("/website_mail/static/src/img/blocks/block_header_center_logo.png"); + background-image: url("/mass_mailing/static/src/img/blocks/block_header_center_logo.png"); } .oe_snippet.o_mail_block_header_center_text .oe_snippet_thumbnail_img { - background-image: url("/website_mail/static/src/img/blocks/block_header_center_text.png"); + background-image: url("/mass_mailing/static/src/img/blocks/block_header_center_text.png"); } .oe_snippet.o_mail_block_header_social .oe_snippet_thumbnail_img { - background-image: url("/website_mail/static/src/img/blocks/block_header_social.png"); + background-image: url("/mass_mailing/static/src/img/blocks/block_header_social.png"); } .oe_snippet.o_mail_block_header_text_social .oe_snippet_thumbnail_img { - background-image: url("/website_mail/static/src/img/blocks/block_header_text_social.png"); + background-image: url("/mass_mailing/static/src/img/blocks/block_header_text_social.png"); } .oe_snippet.o_mail_block_text_image .oe_snippet_thumbnail_img { - background-image: url("/website/static/src/img/blocks/block_text_image.png"); + background-image: url("/mass_mailing/static/src/img/blocks/block_text-image.png"); } .oe_snippet.o_mail_block_footer_copyright .oe_snippet_thumbnail_img { - background-image: url("/website_mail/static/src/img/blocks/block_footer_copyright.png"); + background-image: url("/mass_mailing/static/src/img/blocks/block_footer_copyright.png"); } .oe_snippet.o_mail_block_footer_social .oe_snippet_thumbnail_img { - background-image: url("/website_mail/static/src/img/blocks/block_footer_social.png"); + background-image: url("/mass_mailing/static/src/img/blocks/block_footer_social.png"); } .oe_snippet.o_mail_block_footer_text .oe_snippet_thumbnail_img { - background-image: url("/website_mail/static/src/img/blocks/block_footer_text.png"); + background-image: url("/mass_mailing/static/src/img/blocks/block_footer_text.png"); } .oe_snippet.o_mail_block_footer_seprator .oe_snippet_thumbnail_img { - background-image: url("/website_mail/static/src/img/blocks/block_footer_seprator.png"); + background-image: url("/mass_mailing/static/src/img/blocks/block_footer_seprator.png"); } .oe_snippet.o_mail_block_footer_tag_line .oe_snippet_thumbnail_img { - background-image: url("/website_mail/static/src/img/blocks/block_footer_tag_line.png"); + background-image: url("/mass_mailing/static/src/img/blocks/block_footer_tag_line.png"); } .oe_snippet.o_mail_block_two_cols .oe_snippet_thumbnail_img{ - background-image: url("/website_mail/static/src/img/blocks/block_two-column-img.png"); + background-image: url("/mass_mailing/static/src/img/blocks/block_two-column-img.png"); } .oe_snippet.o_mail_block_two_cols_content .oe_snippet_thumbnail_img{ - background-image: url("/website_mail/static/src/img/blocks/block_two-column.png"); + background-image: url("/mass_mailing/static/src/img/blocks/block_two-column.png"); } .oe_snippet.o_mail_block_title_text .oe_snippet_thumbnail_img{ - background-image: url("/website_mail/static/src/img/blocks/block_title_text.png") + background-image: url("/mass_mailing/static/src/img/blocks/block_title_text.png") } .oe_snippet.o_mail_block_title_sub .oe_snippet_thumbnail_img{ - background-image: url("/website_mail/static/src/img/blocks/block_title.png") + background-image: url("/mass_mailing/static/src/img/blocks/block_title.png") } .oe_snippet.o_mail_block_image_text .oe_snippet_thumbnail_img{ - background-image: url("/website_mail/static/src/img/blocks/block_image-text.png") + background-image: url("/mass_mailing/static/src/img/blocks/block_image-text.png") } .oe_snippet.o_mail_block_text_button .oe_snippet_thumbnail_img{ background-image: url("/website/static/src/img/blocks/block_jumbotron.png") } .oe_snippet.o_mail_block_table_content .oe_snippet_thumbnail_img{ - background-image: url("/website_mail/static/src/img/blocks/block_table.png") + background-image: url("/mass_mailing/static/src/img/blocks/block_table.png") } .oe_snippet.o_mail_block_discount1 .oe_snippet_thumbnail_img{ - background-image: url("/website_mail/static/src/img/blocks/block_discount.png") + background-image: url("/mass_mailing/static/src/img/blocks/block_discount.png") } .oe_snippet.o_mail_block_discount2 .oe_snippet_thumbnail_img{ - background-image: url("/website_mail/static/src/img/blocks/block_discount2.png") + background-image: url("/mass_mailing/static/src/img/blocks/block_discount2.png") } .oe_snippet.o_mail_block_event .oe_snippet_thumbnail_img{ - background-image: url("/website_mail/static/src/img/blocks/block_event.png") + background-image: url("/mass_mailing/static/src/img/blocks/block_event.png") } .oe_snippet.o_mail_block_image .oe_snippet_thumbnail_img{ - background-image: url("/website_mail/static/src/img/blocks/block_image_text.png") + background-image: url("/mass_mailing/static/src/img/blocks/block_image_text.png") } .oe_snippet.o_mail_block_profile .oe_snippet_thumbnail_img{ - background-image: url("/website_mail/static/src/img/blocks/block_user.png") + background-image: url("/mass_mailing/static/src/img/blocks/block_user.png") } .oe_snippet.o_mail_block_four_cols .oe_snippet_thumbnail_img{ - background-image: url("/website_mail/static/src/img/blocks/block_four_columns.png") + background-image: url("/mass_mailing/static/src/img/blocks/block_four_columns.png") } .oe_snippet.o_mail_block_button .oe_snippet_thumbnail_img{ - background-image: url("/website_mail/static/src/img/blocks/block_button.png") + background-image: url("/mass_mailing/static/src/img/blocks/block_button.png") } .oe_snippet.o_mail_block_simple_text .oe_snippet_thumbnail_img{ - background-image: url("/website_mail/static/src/img/blocks/block_simple_text.png") + background-image: url("/mass_mailing/static/src/img/blocks/block_simple_text.png") } .oe_snippet.o_mail_block_three_cols .oe_snippet_thumbnail_img{ - background-image: url("/website_mail/static/src/img/blocks/block_three_columns.png") + background-image: url("/mass_mailing/static/src/img/blocks/block_three_columns.png") } .oe_snippet.o_mail_block_text_on_img .oe_snippet_thumbnail_img{ - background-image: url("/website_mail/static/src/img/blocks/block_text_on_image.png") + background-image: url("/mass_mailing/static/src/img/blocks/block_text_on_image.png") } .oe_snippet.o_mail_block_steps .oe_snippet_thumbnail_img{ - background-image: url("/website_mail/static/src/img/blocks/block_steps.png") + background-image: url("/mass_mailing/static/src/img/blocks/block_steps.png") } diff --git a/addons/mass_mailing/static/src/css/mass_mailing_popup.css b/addons/mass_mailing/static/src/css/mass_mailing_popup.css index 084cc2a2ce6..9a81138b9c1 100644 --- a/addons/mass_mailing/static/src/css/mass_mailing_popup.css +++ b/addons/mass_mailing/static/src/css/mass_mailing_popup.css @@ -1,7 +1,7 @@ /* Summernote not Support for placeholder text https://github.com/summernote/summernote/issues/581 */ .editor_enable [data-oe-placeholder]:empty:not(:focus):before { - content: attr(data-oe-placeholder); - opacity: 0.3; + content: " \00a0 " attr(data-oe-placeholder); + opacity: 0.4; } .o_popup_animated { -webkit-animation-duration: 1s; diff --git a/addons/website_mail/static/src/img/blocks/block_button.png b/addons/mass_mailing/static/src/img/blocks/block_button.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_button.png rename to addons/mass_mailing/static/src/img/blocks/block_button.png diff --git a/addons/website_mail/static/src/img/blocks/block_discount.png b/addons/mass_mailing/static/src/img/blocks/block_discount.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_discount.png rename to addons/mass_mailing/static/src/img/blocks/block_discount.png diff --git a/addons/website_mail/static/src/img/blocks/block_discount2.png b/addons/mass_mailing/static/src/img/blocks/block_discount2.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_discount2.png rename to addons/mass_mailing/static/src/img/blocks/block_discount2.png diff --git a/addons/website_mail/static/src/img/blocks/block_event.png b/addons/mass_mailing/static/src/img/blocks/block_event.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_event.png rename to addons/mass_mailing/static/src/img/blocks/block_event.png diff --git a/addons/website_mail/static/src/img/blocks/block_footer_copyright.png b/addons/mass_mailing/static/src/img/blocks/block_footer_copyright.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_footer_copyright.png rename to addons/mass_mailing/static/src/img/blocks/block_footer_copyright.png diff --git a/addons/website_mail/static/src/img/blocks/block_footer_seprator.png b/addons/mass_mailing/static/src/img/blocks/block_footer_seprator.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_footer_seprator.png rename to addons/mass_mailing/static/src/img/blocks/block_footer_seprator.png diff --git a/addons/website_mail/static/src/img/blocks/block_footer_social.png b/addons/mass_mailing/static/src/img/blocks/block_footer_social.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_footer_social.png rename to addons/mass_mailing/static/src/img/blocks/block_footer_social.png diff --git a/addons/website_mail/static/src/img/blocks/block_footer_tag_line.png b/addons/mass_mailing/static/src/img/blocks/block_footer_tag_line.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_footer_tag_line.png rename to addons/mass_mailing/static/src/img/blocks/block_footer_tag_line.png diff --git a/addons/website_mail/static/src/img/blocks/block_footer_text.png b/addons/mass_mailing/static/src/img/blocks/block_footer_text.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_footer_text.png rename to addons/mass_mailing/static/src/img/blocks/block_footer_text.png diff --git a/addons/website_mail/static/src/img/blocks/block_four_columns.png b/addons/mass_mailing/static/src/img/blocks/block_four_columns.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_four_columns.png rename to addons/mass_mailing/static/src/img/blocks/block_four_columns.png diff --git a/addons/website_mail/static/src/img/blocks/block_header_center_logo.png b/addons/mass_mailing/static/src/img/blocks/block_header_center_logo.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_header_center_logo.png rename to addons/mass_mailing/static/src/img/blocks/block_header_center_logo.png diff --git a/addons/website_mail/static/src/img/blocks/block_header_center_text.png b/addons/mass_mailing/static/src/img/blocks/block_header_center_text.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_header_center_text.png rename to addons/mass_mailing/static/src/img/blocks/block_header_center_text.png diff --git a/addons/website_mail/static/src/img/blocks/block_header_social.png b/addons/mass_mailing/static/src/img/blocks/block_header_social.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_header_social.png rename to addons/mass_mailing/static/src/img/blocks/block_header_social.png diff --git a/addons/website_mail/static/src/img/blocks/block_header_text_social.png b/addons/mass_mailing/static/src/img/blocks/block_header_text_social.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_header_text_social.png rename to addons/mass_mailing/static/src/img/blocks/block_header_text_social.png diff --git a/addons/website_mail/static/src/img/blocks/block_image-text.png b/addons/mass_mailing/static/src/img/blocks/block_image-text.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_image-text.png rename to addons/mass_mailing/static/src/img/blocks/block_image-text.png diff --git a/addons/website_mail/static/src/img/blocks/block_image_text.png b/addons/mass_mailing/static/src/img/blocks/block_image_text.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_image_text.png rename to addons/mass_mailing/static/src/img/blocks/block_image_text.png diff --git a/addons/website_mail/static/src/img/blocks/block_simple_text.png b/addons/mass_mailing/static/src/img/blocks/block_simple_text.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_simple_text.png rename to addons/mass_mailing/static/src/img/blocks/block_simple_text.png diff --git a/addons/website_mail/static/src/img/blocks/block_steps.png b/addons/mass_mailing/static/src/img/blocks/block_steps.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_steps.png rename to addons/mass_mailing/static/src/img/blocks/block_steps.png diff --git a/addons/website_mail/static/src/img/blocks/block_table.png b/addons/mass_mailing/static/src/img/blocks/block_table.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_table.png rename to addons/mass_mailing/static/src/img/blocks/block_table.png diff --git a/addons/mass_mailing/static/src/img/blocks/block_text-image.png b/addons/mass_mailing/static/src/img/blocks/block_text-image.png new file mode 100644 index 00000000000..edbf697a2d0 Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_text-image.png differ diff --git a/addons/website_mail/static/src/img/blocks/block_text_on_image.png b/addons/mass_mailing/static/src/img/blocks/block_text_on_image.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_text_on_image.png rename to addons/mass_mailing/static/src/img/blocks/block_text_on_image.png diff --git a/addons/website_mail/static/src/img/blocks/block_three_columns.png b/addons/mass_mailing/static/src/img/blocks/block_three_columns.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_three_columns.png rename to addons/mass_mailing/static/src/img/blocks/block_three_columns.png diff --git a/addons/website_mail/static/src/img/blocks/block_title.png b/addons/mass_mailing/static/src/img/blocks/block_title.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_title.png rename to addons/mass_mailing/static/src/img/blocks/block_title.png diff --git a/addons/website_mail/static/src/img/blocks/block_title_text.png b/addons/mass_mailing/static/src/img/blocks/block_title_text.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_title_text.png rename to addons/mass_mailing/static/src/img/blocks/block_title_text.png diff --git a/addons/website_mail/static/src/img/blocks/block_two-column-img.png b/addons/mass_mailing/static/src/img/blocks/block_two-column-img.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_two-column-img.png rename to addons/mass_mailing/static/src/img/blocks/block_two-column-img.png diff --git a/addons/website_mail/static/src/img/blocks/block_two-column.png b/addons/mass_mailing/static/src/img/blocks/block_two-column.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_two-column.png rename to addons/mass_mailing/static/src/img/blocks/block_two-column.png diff --git a/addons/website_mail/static/src/img/blocks/block_user.png b/addons/mass_mailing/static/src/img/blocks/block_user.png similarity index 100% rename from addons/website_mail/static/src/img/blocks/block_user.png rename to addons/mass_mailing/static/src/img/blocks/block_user.png diff --git a/addons/website_mail/static/src/img/theme_imgs/airmail.png b/addons/mass_mailing/static/src/img/theme_imgs/airmail.png similarity index 100% rename from addons/website_mail/static/src/img/theme_imgs/airmail.png rename to addons/mass_mailing/static/src/img/theme_imgs/airmail.png diff --git a/addons/website_mail/static/src/img/theme_imgs/skyline_bg.gif b/addons/mass_mailing/static/src/img/theme_imgs/skyline_bg.gif similarity index 100% rename from addons/website_mail/static/src/img/theme_imgs/skyline_bg.gif rename to addons/mass_mailing/static/src/img/theme_imgs/skyline_bg.gif diff --git a/addons/website_mail/static/src/img/theme_imgs/social_facebook.png b/addons/mass_mailing/static/src/img/theme_imgs/social_facebook.png similarity index 100% rename from addons/website_mail/static/src/img/theme_imgs/social_facebook.png rename to addons/mass_mailing/static/src/img/theme_imgs/social_facebook.png diff --git a/addons/website_mail/static/src/img/theme_imgs/social_googleplus.png b/addons/mass_mailing/static/src/img/theme_imgs/social_googleplus.png similarity index 100% rename from addons/website_mail/static/src/img/theme_imgs/social_googleplus.png rename to addons/mass_mailing/static/src/img/theme_imgs/social_googleplus.png diff --git a/addons/website_mail/static/src/img/theme_imgs/social_linkedin.png b/addons/mass_mailing/static/src/img/theme_imgs/social_linkedin.png similarity index 100% rename from addons/website_mail/static/src/img/theme_imgs/social_linkedin.png rename to addons/mass_mailing/static/src/img/theme_imgs/social_linkedin.png diff --git a/addons/website_mail/static/src/img/theme_imgs/social_rss.png b/addons/mass_mailing/static/src/img/theme_imgs/social_rss.png similarity index 100% rename from addons/website_mail/static/src/img/theme_imgs/social_rss.png rename to addons/mass_mailing/static/src/img/theme_imgs/social_rss.png diff --git a/addons/website_mail/static/src/img/theme_imgs/social_twitter.png b/addons/mass_mailing/static/src/img/theme_imgs/social_twitter.png similarity index 100% rename from addons/website_mail/static/src/img/theme_imgs/social_twitter.png rename to addons/mass_mailing/static/src/img/theme_imgs/social_twitter.png diff --git a/addons/website_mail/static/src/js/website_email_designer.js b/addons/mass_mailing/static/src/js/mass_mailing_editor.js similarity index 52% rename from addons/website_mail/static/src/js/website_email_designer.js rename to addons/mass_mailing/static/src/js/mass_mailing_editor.js index beafd4a6b5e..9449af6445f 100644 --- a/addons/website_mail/static/src/js/website_email_designer.js +++ b/addons/mass_mailing/static/src/js/mass_mailing_editor.js @@ -2,18 +2,19 @@ odoo.define('website_mail.website_mail', function (require) { "use strict"; var Model = require('web.Model'); -var editor = require('website.editor'); -var snippets_editor = require('website.snippets.editor'); - +var rte = require('web_editor.rte'); +var web_editor = require('web_editor.editor'); +var options = require('web_editor.snippets.options'); +var snippets_editor = require('web_editor.snippet.editor'); // Snippet option for resizing image and column width inline like excel -snippets_editor.options["width-x"] = snippets_editor.Option.extend({ +options.registry["width-x"] = options.Class.extend({ start: function () { this.container_width = 600; var parent = this.$target.closest('[data-max-width]'); if( parent.length ){ this.container_width = parseInt(parent.attr('data-max-width')); - } + } var self = this; var offset, sib_offset, target_width, sib_width; this.is_image = false; @@ -58,7 +59,7 @@ snippets_editor.options["width-x"] = snippets_editor.Option.extend({ if (compass === 'image'){ self.change_width(event, self.$target, target_width, offset ,'plus'); } - }; + } var body_mouseup = function(){ $body.unbind('mousemove', body_mousemove); $body.unbind('mouseup', body_mouseup); @@ -89,7 +90,7 @@ snippets_editor.options["width-x"] = snippets_editor.Option.extend({ var self = this; _.each($el.siblings(),function(sib){ max_width += self.get_int_width($(sib)); - }); + }) return this.container_width - max_width; }, on_clone: function ($clone) { @@ -99,7 +100,7 @@ snippets_editor.options["width-x"] = snippets_editor.Option.extend({ _.each($table.find('tbody>tr'),function(row){ var clone_selector = 'td:eq(' + clone_index + ')'; var $col_to_clone = $(row).find(clone_selector); - if($col_to_clone.length !== 0){ + if($col_to_clone.length != 0){ $col_to_clone.after($col_to_clone.clone()); } }); @@ -128,31 +129,22 @@ $.summernote.eventHandler.popover.update = function ($popover, oStyle, isAirMode $("span.o_table_handler, div.note-table").remove(); }; -editor.EditorBar.include({ +web_editor.Class.include({ start: function () { var self = this; if (location.search.indexOf("enable_editor") !== -1) { - this.on('rte:ready', this, function () { + this.on('rte:start', this, function () { $("#choose_template").off("click").on("click", _.bind(self.on_choose_template, self)); $(".theme_thumbnail [data-snippet-theme]").off("click").on("click", _.bind(self.on_set_snippet_theme, self)); - $("#wrapwrap").on('click', function (event) { - if ($(event.target).is("#wrapwrap")) { - setTimeout(function () { - var node = $("#wrapwrap .o_editable:first *") - .filter(function () { return this.textContent.match(/\S|\u00A0/); }) - .add($("#wrapwrap .o_editable:first")) - .last()[0]; - $.summernote.core.range.create(node, $.summernote.core.dom.nodeLength(node)).select(); - },0); - } - }); + var $editable = $("#editable_area"); + $editable.html($editable.prop("innerHTML").replace(/^]*>\s*<\/p>$/, '')); }); this.on("snippets:ready", this, _.bind(self.display_theme_from_html, self)); } return this._super.apply(this, arguments); }, display_theme_from_html: function () { - var theme = $("#wrapwrap .o_editable:first [data-snippet-theme]").data("snippet-theme"); + var theme = $("#editable_area [data-snippet-theme]").data("snippet-theme"); if (theme) { $("#choose_template").show(); this.set_snippet_theme(theme); @@ -170,7 +162,7 @@ editor.EditorBar.include({ if (event) { $("#choose_template").show(); } - var $editable = $("#wrapwrap .o_editable:first"); + var $editable = $("#editable_area"); $(".o_table_handler").remove(); $editable.parent().add("#oe_snippets, #templates, .note-popover").toggleClass("hidden"); $("#choose_template").children().toggleClass("hidden"); @@ -178,7 +170,7 @@ editor.EditorBar.include({ $(window.top).trigger('resize'); }, on_set_snippet_template: function (event) { - var $editable = $("#wrapwrap .o_editable:first"); + var $editable = $("#editable_area"); this.rte.historyRecordUndo($editable); $editable.html( $(event.target).closest(".theme_thumbnail").find(".js_content").html() ); $editable.parent().add("#oe_snippets, #templates, .note-popover").toggleClass("hidden"); @@ -201,7 +193,7 @@ editor.EditorBar.include({ get_snippet_template: function (mailing_model) { var self = this; var domain = [['model', '=', mailing_model]]; - new Model('mail.template').call('search_read', [domain]).then(function (datas) { + return new Model('mail.template').call('search_read', [domain]).then(function (datas) { var $template = $("#templates > div:last").addClass("hidden"); var $tclone = $template.find("> div > div:first"); $tclone.siblings().remove(); @@ -221,193 +213,33 @@ editor.EditorBar.include({ } }); -var cache = {}; -var rulesCache = []; -function getMatchedCSSRules(a) { - if(cache[a.tagName + "." +a.className]) { - return cache[a.tagName + "." +a.className]; - } - if (!rulesCache.length) { - var sheets = document.styleSheets; - for(var i = 0; i < sheets.length; i++) { - var rules = sheets[i].rules || sheets[i].cssRules; - if (rules) { - for(var r = 0; r < rules.length; r++) { - var selectorText = rules[r].selectorText; - if (selectorText && - rules[r].cssText && - selectorText.indexOf(".") !== -1 && - selectorText.indexOf(":hover") === -1 && - selectorText.indexOf(":before") === -1 && - selectorText.indexOf(":after") === -1 && - selectorText.indexOf(":active") === -1 && - selectorText.indexOf(":link") === -1 && - selectorText.indexOf("::") === -1) { - var st = selectorText.split(/\s*,\s*/); - for (var k=0; k div:not(.hidden)").attr("class") || "").replace(/^\s*|\s*o_mail_block[^\s]+\s*|\s*oe_snippet\s*|\s*ui-draggable\s*|\s*$/g, ''); - var $theme = $("#wrapwrap .o_editable:first [data-snippet-theme]").removeAttr("data-snippet-theme").removeData("snippet-theme"); + var $theme = $("#editable_area [data-snippet-theme]").removeAttr("data-snippet-theme").removeData("snippet-theme"); $editable.children().first().attr("data-snippet-theme", theme); - $editable.find(":hidden").remove(); + $editable.find(":not(br):hidden").remove(); }, - // convert font awsome into image - font_to_img: function () { - $("#wrapwrap .fa").each(function () { - var $font = $(this); - var content; - _.find(editor.fontIcons, function (font) { - return _.find(editor.getCssSelectors(font.parser), function (css) { - if ($font.is(css[0].replace(/::?before$/, ''))) { - content = css[1].match(/content:\s*['"](.)['"]/)[1]; - return true; - } - }); - }); - if (content) { - var size = parseInt(parseFloat($font.css("font-size"))/parseFloat($font.parent().css("font-size")),10); - var src = _.str.sprintf('/website_mail/font_to_img/%s/%s/'+$font.width(), window.encodeURI(content), window.encodeURI($font.css("color"))); - var $img = $("").attr("src", src) - .attr("data-class", $font.attr("class")) - .attr("style", $font.attr("style")) - .css({"height": size+"em"}).css("font-size", ""); - $font.replaceWith($img); - } else { - $font.remove(); - } - }); - }, - // convert image into font awsome - img_to_font: function () { - $("#wrapwrap img[src*='/website_mail/font_to_img/']").each(function () { - var $img = $(this); - var $font = $("").attr("class", $img.data("class")).attr("style", $img.attr("style")).css("height", ""); - $img.replaceWith($font); - }); - }, - - class_to_style: function () { - var $editable = $("#wrapwrap .o_editable:first"); - var selector = _.map(rulesCache, function (a) { return a.selector;}).join(","); - $editable.find(selector).each(function () { - var $target = $(this); - var css = getMatchedCSSRules(this); - var style = $target.attr("style") || ""; - _.each(css, function (v,k) { - if (style.indexOf(k) === -1) { - style = k+":"+v+";"+style; - } - }); - $target.attr("style", style); - }); - }, - - style_to_class: function () { - var $editable = $("#wrapwrap .o_editable:first"); - getMatchedCSSRules($editable[0]); - var selector = _.map(rulesCache, function (a) { return a.selector;}).join(","); - var $c = $('').appendTo("body"); - $editable.find(selector).each(function () { - var $target = $(this); - var css = getMatchedCSSRules(this); - var style = ""; - _.each(css, function (v,k) { - if (style.indexOf(k) === -1) { - style = k+":"+v+";"+style; - } - }); - css = $c.attr("style", style).attr("style").split(/\s*;\s*/); - style = $target.attr("style") || ""; - _.each(css, function (v) { - style = style.replace(v, ''); - }); - $target.attr("style", style.replace(/;+(\s;)*/g, ';').replace(/^;/g, '')); - }); - $c.remove(); - } }); - -window.top.odoo[callback+"_set_value"] = function (value, fields_values, field_name) { - var $editable = $("#wrapwrap .o_editable:first"); - var editor_enable = $('body').hasClass('editor_enable'); +var _set_value = window.top.odoo[callback+"_updown"]; +window.top.odoo[callback+"_updown"] = function (value, fields_values, field_name) { + var $editable = $("#editable_area"); var _val = $editable.prop("innerHTML"); + var editor_enable = $('body').hasClass('editor_enable'); value = value || ""; - - if(value !== _val) { + + if(value !==_val) { if (editor_enable) { if (value !== fields_values[field_name]) { - editor.editor_bar.rte.historyRecordUndo($editable, true); + rte.history.recordUndo($editable); } - editor.editor_bar.snippets.make_active(false); + snippets_editor.instance.make_active(false); } if (value.indexOf('on_change_model_and_list') === -1) { @@ -415,11 +247,7 @@ window.top.odoo[callback+"_set_value"] = function (value, fields_values, field_n $editable.html(value); if (editor_enable) { - editor.editor_bar.snippets.img_to_font(); - editor.editor_bar.snippets.style_to_class(); - if (fields_values.mailing_model) { - editor.editor_bar.display_theme_from_html(); - } + web_editor.editor_bar.display_theme_from_html(); if (value !== fields_values[field_name]) { $editable.trigger("content_changed"); @@ -428,17 +256,12 @@ window.top.odoo[callback+"_set_value"] = function (value, fields_values, field_n } } - if (fields_values.mailing_model) { - editor.editor_bar.get_snippet_template(fields_values.mailing_model); + if (fields_values.mailing_model && web_editor.editor_bar) { + web_editor.editor_bar.get_snippet_template(fields_values.mailing_model); if (value.indexOf('on_change_model_and_list') !== -1) { window.top.odoo[callback+"_downup"](_val); } } }; - -return { - getMatchedCSSRules: getMatchedCSSRules -}; - }); diff --git a/addons/mass_mailing/static/src/js/website_mass_mailing.editor.js b/addons/mass_mailing/static/src/js/website_mass_mailing.editor.js index 33fbbaa637f..eced083d6d0 100644 --- a/addons/mass_mailing/static/src/js/website_mass_mailing.editor.js +++ b/addons/mass_mailing/static/src/js/website_mass_mailing.editor.js @@ -1,65 +1,31 @@ odoo.define('website_mass_mailing.editor', function (require) { 'use strict'; +var Model = require('web.Model'); var ajax = require('web.ajax'); var core = require('web.core'); -var editor = require('website.editor'); -var snippet_editor = require('website.snippet.editor'); +var base = require('web_editor.base'); +var web_editor = require('web_editor.editor'); +var options = require('web_editor.snippets.options'); +var snippet_editor = require('web_editor.snippet.editor'); var website = require('website.website'); - var _t = core._t; -snippet_editor.options.mailing_list_subscribe = snippet_editor.Option.extend({ - choose_mailing_list: function (type, value) { - var self = this; - if (type !== "click") return; - return website.prompt({ - id: "editor_new_mailing_list_subscribe_button", - window_title: _t("Add a Newsletter Subscribe Button"), - select: _t("Newsletter"), - init: function (field) { - return website.session.model('mail.mass_mailing.list') - .call('name_search', ['', []], { context: website.get_context() }); - }, - }).then(function (mailing_list_id) { - self.$target.attr("data-list-id", mailing_list_id); - }); - }, - drop_and_build_snippet: function() { - var self = this; - this._super(); - this.choose_mailing_list('click').fail(function () { - self.editor.on_remove($.Event( "click" )); - }); - }, - clean_for_save: function () { - this.$target.addClass("hidden"); - }, -}); -website.snippet.options.newsletter_popup = website.snippet.Option.extend({ - select_mailing_list: function (type) { +var mass_mailing_common = options.Class.extend({ + popup_template_id: "editor_new_mailing_list_subscribe_button", + popup_title: _t("Add a Newsletter Subscribe Button"), + select_mailing_list: function (type, value) { var self = this; if (type !== "click") return; return website.prompt({ - id: "editor_new_mailing_list_subscribe_popup", - window_title: _t("Add a Newsletter Subscribe Popup"), - select: _t("Newsletter"), - init: function () { - return website.session.model('mail.mass_mailing.list') - .call('name_search', [], { context: website.get_context() }); + 'id': this.popup_template_id, + 'window_title': this.popup_title, + 'select': _t("Newsletter"), + 'init': function (field) { + return new Model('mail.mass_mailing.list').call('name_search', ['', []], { context: base.get_context() }); }, }).then(function (mailing_list_id) { - ajax.jsonRpc('/web/dataset/call', 'call', { - model: 'mail.mass_mailing.list', - method: 'read', - args: [[parseInt(mailing_list_id)], ['popup_content'], website.get_context()], - }).then(function (data) { - self.$target.find(".o_popup_content_dev").empty(); - if (data && data[0].popup_content) { - $(data[0].popup_content).appendTo(self.$target.find(".o_popup_content_dev")); - } - }); self.$target.attr("data-list-id", mailing_list_id); }); }, @@ -72,7 +38,32 @@ website.snippet.options.newsletter_popup = website.snippet.Option.extend({ }, }); -editor.EditorBar.include({ +options.registry.mailing_list_subscribe = mass_mailing_common.extend({ + clean_for_save: function () { + this.$target.addClass("hidden"); + }, +}); + +options.registry.newsletter_popup = mass_mailing_common.extend({ + popup_template_id: "editor_new_mailing_list_subscribe_popup", + popup_title: _t("Add a Newsletter Subscribe Popup"), + select_mailing_list: function (type, value) { + return this._super(type, value).then(function (mailing_list_id) { + ajax.jsonRpc('/web/dataset/call', 'call', { + model: 'mail.mass_mailing.list', + method: 'read', + args: [[parseInt(mailing_list_id)], ['popup_content'], base.get_context()], + }).then(function (data) { + self.$target.find(".o_popup_content_dev").empty(); + if (data && data[0].popup_content) { + $(data[0].popup_content).appendTo(self.$target.find(".o_popup_content_dev")); + } + }); + }); + }, +}); + +web_editor.Class.include({ edit: function () { this._super(); $('body').on('click','#edit_dialog',_.bind(this.edit_dialog, this.rte.editor)); @@ -84,7 +75,7 @@ editor.EditorBar.include({ $target.css("display", "none"); $('.o_popup_bounce_small').show(); if (!$target.find('.o_popup_content_dev').length) { - $target.find('.o_popup_modal_body').prepend($('
')); + $target.find('.o_popup_modal_body').prepend($('
')); } var content = $('#wrapwrap .o_popup_content_dev').html(); var newsletter_id = $target.parent().attr('data-list-id'); @@ -93,7 +84,7 @@ editor.EditorBar.include({ method: 'write', args: [parseInt(newsletter_id), {'popup_content':content}, - website.get_context()], + base.get_context()], }); } return this._super(); diff --git a/addons/mass_mailing/static/src/js/website_mass_mailing.js b/addons/mass_mailing/static/src/js/website_mass_mailing.js index 5af42260990..2d0760a202a 100644 --- a/addons/mass_mailing/static/src/js/website_mass_mailing.js +++ b/addons/mass_mailing/static/src/js/website_mass_mailing.js @@ -3,10 +3,11 @@ odoo.define('mass_mailing.website_integration', function (require) { var ajax = require('web.ajax'); var utils = require('web.utils'); -var animation = require('website.snippets.animation'); +var animation = require('web_editor.snippets.animation'); var website = require('website.website'); -animation.registry.subscribe = animation.Animation.extend({ + +animation.registry.subscribe = animation.Class.extend({ selector: ".js_subscribe", start: function (editable_mode) { var self = this; @@ -59,7 +60,7 @@ animation.registry.subscribe = animation.Animation.extend({ }, }); -animation.registry.newsletter_popup = animation.Animation.extend({ +animation.registry.newsletter_popup = animation.Class.extend({ selector: ".o_newsletter_popup", start: function (editable_mode) { var self = this; @@ -96,11 +97,11 @@ animation.registry.newsletter_popup = animation.Animation.extend({ ajax.jsonRpc('/website_mass_mailing/subscribe', 'call', { 'list_id': self.$target.data('list-id'), 'email': $email.length ? $email.val() : false - }).then(function () { + }).then(function (subscribe) { self.$target.find('#o_newsletter_popup').modal('hide'); $(document).off('mouseleave'); if (self.redirect_url) { - if (_.contains(self.redirect_url.split('/'), window.location.host) || self.redirect_url.indexOf('/')=== 0) { + if (_.contains(self.redirect_url.split('/'), window.location.host) || self.redirect_url.indexOf('/')== 0) { window.location.href = self.redirect_url; } else { window.open(self.redirect_url, '_blank'); } } @@ -136,12 +137,12 @@ website.if_dom_contains('div.o_unsubscribe_form', function() { }); ajax.jsonRpc('/mail/mailing/unsubscribe', 'call', {'opt_in_ids': checked_ids, 'opt_out_ids': unchecked_ids, 'email': email, 'mailing_id': mailing_id}) - .then(function() { + .then(function(result) { $('.alert-info').html('Your changes has been saved.').removeClass('alert-info').addClass('alert-success'); }) .fail(function() { $('.alert-info').html('You changes has not been saved, try again later.').removeClass('alert-info').addClass('alert-warning'); - }); + }); }); }); diff --git a/addons/mass_mailing/views/editor_field_html.xml b/addons/mass_mailing/views/editor_field_html.xml new file mode 100644 index 00000000000..5cc26b0dab7 --- /dev/null +++ b/addons/mass_mailing/views/editor_field_html.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + diff --git a/addons/mass_mailing/views/email_template.xml b/addons/mass_mailing/views/email_template.xml index 377d3084362..36698ac6106 100644 --- a/addons/mass_mailing/views/email_template.xml +++ b/addons/mass_mailing/views/email_template.xml @@ -28,7 +28,7 @@ - + diff --git a/addons/mass_mailing/views/mass_mailing.xml b/addons/mass_mailing/views/mass_mailing.xml index c5414ec5026..2e1e1859d83 100644 --- a/addons/mass_mailing/views/mass_mailing.xml +++ b/addons/mass_mailing/views/mass_mailing.xml @@ -264,7 +264,7 @@ - + @@ -444,7 +444,7 @@ - + diff --git a/addons/mass_mailing/views/snippets.xml b/addons/mass_mailing/views/snippets.xml index fa1982a20d6..14757594900 100644 --- a/addons/mass_mailing/views/snippets.xml +++ b/addons/mass_mailing/views/snippets.xml @@ -32,85 +32,85 @@ - + + + + diff --git a/addons/website_mail/views/snippets.xml b/addons/mass_mailing/views/snippets_themes.xml similarity index 95% rename from addons/website_mail/views/snippets.xml rename to addons/mass_mailing/views/snippets_themes.xml index e7606deb076..a102d2f7a6a 100644 --- a/addons/website_mail/views/snippets.xml +++ b/addons/mass_mailing/views/snippets_themes.xml @@ -100,19 +100,19 @@
- social icon + social icon - social icon + social icon - social icon + social icon - social icon + social icon - social icon + social icon
@@ -137,19 +137,19 @@
- social icon + social icon - social icon + social icon - social icon + social icon - social icon + social icon - social icon + social icon
@@ -412,27 +412,27 @@ &nbsp; - social icon + social icon - social icon + social icon - social icon + social icon - social icon + social icon - social icon + social icon &nbsp; @@ -496,7 +496,8 @@ diff --git a/addons/website_mail/views/snippet_options.xml b/addons/mass_mailing/views/snippets_themes_options.xml similarity index 88% rename from addons/website_mail/views/snippet_options.xml rename to addons/mass_mailing/views/snippets_themes_options.xml index 531579de333..7b2248b88c8 100644 --- a/addons/website_mail/views/snippet_options.xml +++ b/addons/mass_mailing/views/snippets_themes_options.xml @@ -9,11 +9,6 @@ data-selector="img, .mv, .col_mv"> - -
@@ -35,7 +30,6 @@ data-drop-in="[data-oe-field='body_html']">
-
diff --git a/addons/website_mail/views/theme/airmail_snippets.xml b/addons/mass_mailing/views/theme/airmail_snippets.xml similarity index 99% rename from addons/website_mail/views/theme/airmail_snippets.xml rename to addons/mass_mailing/views/theme/airmail_snippets.xml index 22d31a416bd..abca4fcf0ba 100644 --- a/addons/website_mail/views/theme/airmail_snippets.xml +++ b/addons/mass_mailing/views/theme/airmail_snippets.xml @@ -5,7 +5,7 @@