Browse Source

commit inicial

edgar 8 năm trước cách đây
commit
d706b302c4
12 tập tin đã thay đổi với 328 bổ sung0 xóa
  1. 72 0
      README.rst
  2. 0 0
      __init__.py
  3. BIN
      __init__.pyc
  4. 21 0
      __openerp__.py
  5. 42 0
      i18n/es.po
  6. 38 0
      i18n/fr.po
  7. 37 0
      i18n/sl.po
  8. BIN
      static/description/icon.png
  9. 40 0
      static/description/icon.svg
  10. 38 0
      static/src/js/vertical_resize.js
  11. 16 0
      views/assets.xml
  12. 24 0
      views/snippets.xml

+ 72 - 0
README.rst

@@ -0,0 +1,72 @@
+.. 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
+
+======================================
+Base for Vertical Resizing of Snippets
+======================================
+
+This module extends the functionality of the website mail designer to support
+setting a fixed height in pixels to some elements.
+
+Installation
+============
+
+This module is a technical dependency for other modules that want to inherit
+its features, so you don't need to install this manually unless you want to use
+its features directly (maybe by putting the class in a template element).
+
+When installed, any HTML element in the website mail designer that has the
+``vertical_resizable`` will have a new option to ask the user to input its
+desired height in pixels.
+
+Usage
+=====
+
+When any module installs this one, just click on the desired element and choose
+the *Change Height* option to use 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
+
+Bug Tracker
+===========
+
+Bugs are tracked on `GitHub Issues
+<https://github.com/OCA/social/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
+<https://github.com/OCA/
+social/issues/new?body=module:%20
+website_mail_snippet_vertical_resize_base%0Aversion:%20
+8.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
+
+Credits
+=======
+
+Images
+------
+
+* FontAwesome: `Icon <http://fontawesome.io/icon/arrows-v/>`_.
+
+Contributors
+------------
+
+* Rafael Blasco <rafabn@antiun.com>
+* Jairo Llopis <yajo.sk8@gmail.com>
+
+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.

+ 0 - 0
__init__.py


BIN
__init__.pyc


+ 21 - 0
__openerp__.py

@@ -0,0 +1,21 @@
+# -*- 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": "Base for Vertical Resizing of Snippets",
+    "summary": "Allow input of height in pixels with just a class",
+    "version": "8.0.1.0.0",
+    "category": "Website",
+    "website": "http://www.antiun.com",
+    "author": "Antiun Ingeniería S.L., Odoo Community Association (OCA)",
+    "license": "AGPL-3",
+    "application": False,
+    "installable": True,
+    "depends": [
+        "website_mail",
+    ],
+    "data": [
+        "views/assets.xml",
+        "views/snippets.xml",
+    ],
+}

+ 42 - 0
i18n/es.po

@@ -0,0 +1,42 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * website_mail_snippet_vertical_resize_base
+# 
+# Translators:
+# Carles Antoli <carlesantoli@hotmail.com>, 2016
+# danimaribeiro <danimaribeiro@gmail.com>, 2015-2016
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2014
+# Hotellook, 2014
+# Matjaž Mozetič <m.mozetic@matmoz.si>, 2015
+msgid ""
+msgstr ""
+"Project-Id-Version: social (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-04-30 02:47+0000\n"
+"PO-Revision-Date: 2016-04-24 16:42+0000\n"
+"Last-Translator: Carles Antoli <carlesantoli@hotmail.com>\n"
+"Language-Team: Spanish (http://www.transifex.com/oca/OCA-social-8-0/language/es/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: es\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: website_mail_snippet_vertical_resize_base
+#: view:website:website_mail.email_designer_snippets
+msgid "Change Height"
+msgstr "Cambiar altura"
+
+#. module: website_mail_snippet_vertical_resize_base
+#. openerp-web
+#: code:addons/website_mail_snippet_vertical_resize_base/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_vertical_resize_base
+#. openerp-web
+#: code:addons/website_mail_snippet_vertical_resize_base/static/src/js/vertical_resize.js:22
+#, python-format
+msgid "Set element height"
+msgstr "Ajustar la altura del elemento"

+ 38 - 0
i18n/fr.po

@@ -0,0 +1,38 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * website_mail_snippet_vertical_resize_base
+# 
+# Translators:
+# Christophe CHAUVET <christophe.chauvet@gmail.com>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: social (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-06-30 01:08+0000\n"
+"PO-Revision-Date: 2016-06-17 14:52+0000\n"
+"Last-Translator: Christophe CHAUVET <christophe.chauvet@gmail.com>\n"
+"Language-Team: French (http://www.transifex.com/oca/OCA-social-8-0/language/fr/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: fr\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#. module: website_mail_snippet_vertical_resize_base
+#: view:website:website_mail.email_designer_snippets
+msgid "Change Height"
+msgstr "Changer la hauteur"
+
+#. module: website_mail_snippet_vertical_resize_base
+#. openerp-web
+#: code:addons/website_mail_snippet_vertical_resize_base/static/src/js/vertical_resize.js:23
+#, python-format
+msgid "Element height in pixels"
+msgstr "Hauteur de l'élément en pixels"
+
+#. module: website_mail_snippet_vertical_resize_base
+#. openerp-web
+#: code:addons/website_mail_snippet_vertical_resize_base/static/src/js/vertical_resize.js:22
+#, python-format
+msgid "Set element height"
+msgstr "Saisir la hauteur de l'élément"

+ 37 - 0
i18n/sl.po

@@ -0,0 +1,37 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * website_mail_snippet_vertical_resize_base
+# 
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: social (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-03-07 01:55+0000\n"
+"PO-Revision-Date: 2016-02-29 07:44+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-social-8-0/language/sl/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: sl\n"
+"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
+
+#. module: website_mail_snippet_vertical_resize_base
+#: view:website:website_mail.email_designer_snippets
+msgid "Change Height"
+msgstr "Sprememba višine"
+
+#. module: website_mail_snippet_vertical_resize_base
+#. openerp-web
+#: code:addons/website_mail_snippet_vertical_resize_base/static/src/js/vertical_resize.js:23
+#, python-format
+msgid "Element height in pixels"
+msgstr "Višina elementa v pikslih"
+
+#. module: website_mail_snippet_vertical_resize_base
+#. openerp-web
+#: code:addons/website_mail_snippet_vertical_resize_base/static/src/js/vertical_resize.js:22
+#, python-format
+msgid "Set element height"
+msgstr "Določi višino elementa"

BIN
static/description/icon.png


+ 40 - 0
static/description/icon.svg

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   version="1.1"
+   id="svg2"
+   viewBox="0 0 100 100"
+   height="100"
+   width="100">
+  <defs
+     id="defs4" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     transform="translate(0,-952.36216)"
+     id="layer1">
+    <text
+       id="text3340"
+       y="1037.1029"
+       x="49.95929"
+       style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:97.27411652px;line-height:87.99999952%;font-family:FontAwesome;-inkscape-font-specification:FontAwesome;text-align:center;writing-mode:lr-tb;text-anchor:middle;opacity:1;fill:#333333;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       xml:space="preserve"><tspan
+         y="1037.1029"
+         x="49.95929"
+         id="tspan3342"></tspan></text>
+  </g>
+</svg>

+ 38 - 0
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);

+ 16 - 0
views/assets.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- © 2016 Antiun Ingeniería S.L. - Jairo Llopis
+     License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
+
+<openerp>
+<data>
+
+<template id="assets_editor" inherit_id="website.assets_editor">
+    <xpath expr=".">
+        <script type="text/javascript"
+                src="/website_mail_snippet_vertical_resize_base/static/src/js/vertical_resize.js"/>
+    </xpath>
+</template>
+
+</data>
+</openerp>

+ 24 - 0
views/snippets.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- © 2016 Antiun Ingeniería S.L. - Jairo Llopis
+     License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
+
+<openerp>
+<data>
+
+<template id="snippet_hr"
+          inherit_id="website_mail.email_designer_snippets">
+    <xpath expr="//div[@id='snippet_options']">
+        <div
+            data-snippet-option-id='vertical_resize'
+            data-selector=".vertical_resizable">
+            <li>
+                <a href="#" class="button js_vertical_resize">
+                    Change Height
+                </a>
+            </li>
+        </div>
+    </xpath>
+</template>
+
+</data>
+</openerp>