diff --git a/website_mail_snippet_responsive/README.rst b/website_mail_snippet_responsive/README.rst new file mode 100644 index 00000000..9f4c9194 --- /dev/null +++ b/website_mail_snippet_responsive/README.rst @@ -0,0 +1,95 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +============================================= +Responsive Layout Snippets for Writing Emails +============================================= + +This module extends the functionality of the website mail designer to support a +responsive layout and allow you to read those mails comfortably in a mobile +mail client. + +Well... actually this is not really responsive. It is pseudo-responsive. +Responsiveness in current mail clients is years behind browsers', so these +templates are very verbose to ensure compatibility in most scenarios. Ideas are +taken from https://css-tricks.com/ideas-behind-responsive-emails/. + +Installation +============ + +This module is prepared to be compatible with module ``website_mail_bg_color``. +If you install it, you will be able to change snippets' background colors, but +it is not required. + +Usage +===== + +To use this module, you need to: + +#. Install any module that makes use of the website mail designer, such as + ``mass_mailing``. +#. Edit an email with the website mail designer. +#. You have a new collection of snippets under *Email Design* section. Use them + as usual. + +If you choose the *Horizontal Separator* snippet, you will be able to set its +height too. For that, you will have to aim carefully to click inside the green +line, and then use the option that will float above it. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/205/8.0 + +Known issues / Roadmap +====================== + +* Snippet is ugly, but that's because mail client HTML engines usually lack + many of the modern CSS and HTML features. I hope we will be able to improve + this as mail clients keep improving. +* To set the *Horizontal Separator* height, you have to click inside it, which + will insert a ``
`` in Firefox, that will make it seem like + its height is at least like a caret, even if you set a lower value. Do not + worry, it goes away when you press *Save*. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed `feedback +`_. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Daniel Gómez-Zurita +* Rafael Blasco +* Jairo Llopis + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/website_mail_snippet_responsive/__init__.py b/website_mail_snippet_responsive/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/website_mail_snippet_responsive/__openerp__.py b/website_mail_snippet_responsive/__openerp__.py new file mode 100644 index 00000000..8435d9db --- /dev/null +++ b/website_mail_snippet_responsive/__openerp__.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# © 2016 Antiun Ingeniería S.L. - Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Responsive Layout Snippets for Writing Emails", + "summary": "Well... pseudo-responsive (see description)", + "version": "8.0.1.0.0", + "category": "Marketing", + "website": "http://www.antiun.com", + "author": "Antiun Ingeniería S.L., Odoo Community Association (OCA)", + "license": "AGPL-3", + "application": False, + "installable": True, + "images": [ + "images/snippets.png", + ], + "depends": [ + "website_mail", + ], + "data": [ + "views/assets.xml", + "views/templates.xml", + "views/snippet_1_col.xml", + "views/snippet_2_cols.xml", + "views/snippet_3_cols.xml", + "views/snippet_hr.xml", + "views/snippet_img_text.xml", + "views/snippet_text_img.xml", + ], +} diff --git a/website_mail_snippet_responsive/i18n/es.po b/website_mail_snippet_responsive/i18n/es.po new file mode 100644 index 00000000..b4018f0c --- /dev/null +++ b/website_mail_snippet_responsive/i18n/es.po @@ -0,0 +1,98 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_mail_snippet_responsive +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-02-10 16:43+0100\n" +"PO-Revision-Date: 2016-02-10 16:44+0100\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" +"X-Generator: Poedit 1.8.6\n" + +#. module: website_mail_snippet_responsive +#: view:website:website_mail.email_designer_snippets +msgid "Big image + Text + Button (1 column)" +msgstr "Imagen grande + texto + botón (1 columna)" + +#. module: website_mail_snippet_responsive +#: view:website:website_mail.email_designer_snippets +msgid "Change Height" +msgstr "Cambiar altura" + +#. module: website_mail_snippet_responsive +#. openerp-web +#: code:addons/website_mail_snippet_responsive/static/src/js/vertical_resize.js:23 +#, python-format +msgid "Element height in pixels" +msgstr "Altura del elemento en píxeles" + +#. module: website_mail_snippet_responsive +#: view:website:website_mail.email_designer_snippets +msgid "Horizontal Separator" +msgstr "Separador horizontal" + +#. module: website_mail_snippet_responsive +#: view:website:website_mail.email_designer_snippets +msgid "Image + Text + Button (2 columns)" +msgstr "Imagen + texto + botón (2 columnas)" + +#. module: website_mail_snippet_responsive +#: view:website:website_mail.email_designer_snippets +msgid "Image + Text + Button (3 columns)" +msgstr "Imagen + texto + botón (3 columnas)" + +#. module: website_mail_snippet_responsive +#: view:website:website_mail.email_designer_snippets +msgid "Integer ut tempor lectus. Vivamus at gravida arcu." +msgstr "Integer ut tempor lectus. Vivamus at gravida arcu." + +#. module: website_mail_snippet_responsive +#: view:website:website_mail.email_designer_snippets +msgid "Learn more" +msgstr "Aprenda más" + +#. module: website_mail_snippet_responsive +#: view:website:website_mail.email_designer_snippets +msgid "Left Image, Right Text + Button" +msgstr "Imagen a la izquierda, texto + botón a la derecha" + +#. module: website_mail_snippet_responsive +#: view:website:website_mail.email_designer_snippets +msgid "Left Text and Button, Right Image" +msgstr "Texto + botón a la izquierda, imagen a la derecha" + +#. module: website_mail_snippet_responsive +#: view:website:website_mail.email_designer_snippets +msgid "" +"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed varius, leo a " +"ullamcorper feugiat, ante purus sodales justo, a faucibus libero lacus a " +"est. Aenean at mollis ipsum." +msgstr "" +"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed varius, leo a " +"ullamcorper feugiat, ante purus sodales justo, a faucibus libero lacus a " +"est. Aenean at mollis ipsum." + +#. module: website_mail_snippet_responsive +#: view:website:website_mail.email_designer_snippets +msgid "News Item" +msgstr "Noticia del boletín" + +#. module: website_mail_snippet_responsive +#. openerp-web +#: code:addons/website_mail_snippet_responsive/static/src/js/vertical_resize.js:22 +#, python-format +msgid "Set element height" +msgstr "" + +#. module: website_mail_snippet_responsive +#: view:website:website_mail.email_designer_snippets +msgid "Title" +msgstr "Título" diff --git a/website_mail_snippet_responsive/images/snippets.png b/website_mail_snippet_responsive/images/snippets.png new file mode 100644 index 00000000..0be2ce80 Binary files /dev/null and b/website_mail_snippet_responsive/images/snippets.png differ diff --git a/website_mail_snippet_responsive/static/description/icon.png b/website_mail_snippet_responsive/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/website_mail_snippet_responsive/static/description/icon.png differ diff --git a/website_mail_snippet_responsive/static/src/img/snippet_1_col.png b/website_mail_snippet_responsive/static/src/img/snippet_1_col.png new file mode 100644 index 00000000..6f39c4d1 Binary files /dev/null and b/website_mail_snippet_responsive/static/src/img/snippet_1_col.png differ diff --git a/website_mail_snippet_responsive/static/src/img/snippet_2_cols.png b/website_mail_snippet_responsive/static/src/img/snippet_2_cols.png new file mode 100644 index 00000000..c9e18815 Binary files /dev/null and b/website_mail_snippet_responsive/static/src/img/snippet_2_cols.png differ diff --git a/website_mail_snippet_responsive/static/src/img/snippet_3_cols.png b/website_mail_snippet_responsive/static/src/img/snippet_3_cols.png new file mode 100644 index 00000000..4afd7cfd Binary files /dev/null and b/website_mail_snippet_responsive/static/src/img/snippet_3_cols.png differ diff --git a/website_mail_snippet_responsive/static/src/img/snippet_hr.png b/website_mail_snippet_responsive/static/src/img/snippet_hr.png new file mode 100644 index 00000000..1c5e0fe1 Binary files /dev/null and b/website_mail_snippet_responsive/static/src/img/snippet_hr.png differ diff --git a/website_mail_snippet_responsive/static/src/img/snippet_img_text.png b/website_mail_snippet_responsive/static/src/img/snippet_img_text.png new file mode 100644 index 00000000..01fe19ce Binary files /dev/null and b/website_mail_snippet_responsive/static/src/img/snippet_img_text.png differ diff --git a/website_mail_snippet_responsive/static/src/img/snippet_text_img.png b/website_mail_snippet_responsive/static/src/img/snippet_text_img.png new file mode 100644 index 00000000..815dd29b Binary files /dev/null and b/website_mail_snippet_responsive/static/src/img/snippet_text_img.png differ diff --git a/website_mail_snippet_responsive/static/src/js/vertical_resize.js b/website_mail_snippet_responsive/static/src/js/vertical_resize.js new file mode 100644 index 00000000..907451e8 --- /dev/null +++ b/website_mail_snippet_responsive/static/src/js/vertical_resize.js @@ -0,0 +1,38 @@ +/* © 2016 Antiun Ingeniería S.L. - Jairo Llopis + * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). */ + +"use strict"; +(function ($) { + var _t = openerp._t, + prompt = openerp.website.prompt, + snippet = openerp.website.snippet; + + snippet.options.vertical_resize = snippet.Option.extend({ + start: function () { + var self = this; + self._super(); + return self.$el.find(".js_vertical_resize").click(function(){ + return self.ask(); + }); + }, + + ask: function() { + var self = this; + return prompt({ + window_title: _t("Set element height"), + input: _t("Element height in pixels"), + }).then(function (answer) { + return self.resize(answer); + }); + }, + + resize: function(size) { + this.$target.css("height", String(size) + "px"); + + // Old-school height attribute changed too if needed + if (this.$target.attr("height")) { + this.$target.attr("height", size); + } + }, + }); +})(jQuery); diff --git a/website_mail_snippet_responsive/views/assets.xml b/website_mail_snippet_responsive/views/assets.xml new file mode 100644 index 00000000..8cacb2a5 --- /dev/null +++ b/website_mail_snippet_responsive/views/assets.xml @@ -0,0 +1,16 @@ + + + + + + +