From 42c215ee1e230ac55788db50e0da8b129dec8b4e Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 22 Feb 2016 17:30:19 +0100 Subject: [PATCH] Complete module renaming, prepare for OCA --- website_mail_snippet_fixed/README.rst | 29 ++++------ website_mail_snippet_fixed/__openerp__.py | 5 +- website_mail_snippet_fixed/i18n/es.po | 58 +++++++++---------- .../static/src/js/vertical_resize.js | 38 ------------ website_mail_snippet_fixed/views/assets.xml | 16 ----- .../views/snippet_1_col.xml | 6 +- .../views/snippet_2_cols.xml | 6 +- .../views/snippet_3_cols.xml | 6 +- .../views/snippet_hr.xml | 18 +----- .../views/snippet_img_text.xml | 6 +- .../views/snippet_text_img.xml | 6 +- .../views/templates.xml | 23 +++++++- 12 files changed, 83 insertions(+), 134 deletions(-) delete mode 100644 website_mail_snippet_fixed/static/src/js/vertical_resize.js delete mode 100644 website_mail_snippet_fixed/views/assets.xml diff --git a/website_mail_snippet_fixed/README.rst b/website_mail_snippet_fixed/README.rst index 9f4c9194..4ea702f0 100644 --- a/website_mail_snippet_fixed/README.rst +++ b/website_mail_snippet_fixed/README.rst @@ -2,18 +2,13 @@ :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 -============================================= -Responsive Layout Snippets for Writing Emails -============================================= +============================================== +Fixed-Width 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/. +This module extends the functionality of the website mail designer with new +snippets with a fixed-width layout that works fine across any mail client, +including MS Outlook. Installation ============ @@ -30,8 +25,8 @@ 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. +#. You have a new collection of snippets under *Fixed 560px Width* 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 @@ -44,9 +39,9 @@ line, and then use the option that will float above it. 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. +* Snippet code 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 @@ -61,7 +56,7 @@ 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 diff --git a/website_mail_snippet_fixed/__openerp__.py b/website_mail_snippet_fixed/__openerp__.py index 32d906ae..460fe6e7 100644 --- a/website_mail_snippet_fixed/__openerp__.py +++ b/website_mail_snippet_fixed/__openerp__.py @@ -2,7 +2,7 @@ # © 2016 Antiun Ingeniería S.L. - Jairo Llopis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { - "name": "Extra Layout Snippets for Writing Emails", + "name": "Fixed-Width Layout Snippets for Writing Emails", "summary": "560px width extra building blocks", "version": "8.0.1.0.0", "category": "Marketing", @@ -15,10 +15,9 @@ "images/snippets.png", ], "depends": [ - "website_mail", + "website_mail_snippet_vertical_resize_base", ], "data": [ - "views/assets.xml", "views/templates.xml", "views/snippet_1_col.xml", "views/snippet_2_cols.xml", diff --git a/website_mail_snippet_fixed/i18n/es.po b/website_mail_snippet_fixed/i18n/es.po index b4018f0c..57bb9ab6 100644 --- a/website_mail_snippet_fixed/i18n/es.po +++ b/website_mail_snippet_fixed/i18n/es.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * website_mail_snippet_responsive +# * website_mail_snippet_fixed # msgid "" msgstr "" @@ -17,60 +17,60 @@ msgstr "" "Plural-Forms: \n" "X-Generator: Poedit 1.8.6\n" -#. module: website_mail_snippet_responsive -#: view:website:website_mail.email_designer_snippets +#. module: website_mail_snippet_fixed +#: view:website:560px_section 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 +#. module: website_mail_snippet_fixed +#: view:website:560px_section msgid "Change Height" msgstr "Cambiar altura" -#. module: website_mail_snippet_responsive +#. module: website_mail_snippet_fixed #. openerp-web -#: code:addons/website_mail_snippet_responsive/static/src/js/vertical_resize.js:23 +#: code:addons/website_mail_snippet_fixed/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 +#. module: website_mail_snippet_fixed +#: view:website:560px_section msgid "Horizontal Separator" msgstr "Separador horizontal" -#. module: website_mail_snippet_responsive -#: view:website:website_mail.email_designer_snippets +#. module: website_mail_snippet_fixed +#: view:website:560px_section 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 +#. module: website_mail_snippet_fixed +#: view:website:560px_section 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 +#. module: website_mail_snippet_fixed +#: view:website:560px_section 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 +#. module: website_mail_snippet_fixed +#: view:website:560px_section msgid "Learn more" msgstr "Aprenda más" -#. module: website_mail_snippet_responsive -#: view:website:website_mail.email_designer_snippets +#. module: website_mail_snippet_fixed +#: view:website:560px_section 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 +#. module: website_mail_snippet_fixed +#: view:website:560px_section 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 +#. module: website_mail_snippet_fixed +#: view:website:560px_section msgid "" "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed varius, leo a " "ullamcorper feugiat, ante purus sodales justo, a faucibus libero lacus a " @@ -80,19 +80,19 @@ msgstr "" "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 +#. module: website_mail_snippet_fixed +#: view:website:560px_section msgid "News Item" msgstr "Noticia del boletín" -#. module: website_mail_snippet_responsive +#. module: website_mail_snippet_fixed #. openerp-web -#: code:addons/website_mail_snippet_responsive/static/src/js/vertical_resize.js:22 +#: code:addons/website_mail_snippet_fixed/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 +#. module: website_mail_snippet_fixed +#: view:website:560px_section msgid "Title" msgstr "Título" diff --git a/website_mail_snippet_fixed/static/src/js/vertical_resize.js b/website_mail_snippet_fixed/static/src/js/vertical_resize.js deleted file mode 100644 index 907451e8..00000000 --- a/website_mail_snippet_fixed/static/src/js/vertical_resize.js +++ /dev/null @@ -1,38 +0,0 @@ -/* © 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_fixed/views/assets.xml b/website_mail_snippet_fixed/views/assets.xml deleted file mode 100644 index 8cacb2a5..00000000 --- a/website_mail_snippet_fixed/views/assets.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - -