Browse Source

[8.0][website_mail_snippet_vertical_resize_base] Resize any element

This commit extract the vertical resizing plugin part from the
`website_mail_snippet_responsive` module into its own module, to allow
reusing it easily.
pull/46/head
Jairo Llopis 9 years ago
parent
commit
d611eeebdf
  1. 3
      website_mail_snippet_responsive/__openerp__.py
  2. 12
      website_mail_snippet_responsive/views/snippet_hr.xml
  3. 72
      website_mail_snippet_vertical_resize_base/README.rst
  4. 0
      website_mail_snippet_vertical_resize_base/__init__.py
  5. 21
      website_mail_snippet_vertical_resize_base/__openerp__.py
  6. BIN
      website_mail_snippet_vertical_resize_base/static/description/icon.png
  7. 0
      website_mail_snippet_vertical_resize_base/static/src/js/vertical_resize.js
  8. 2
      website_mail_snippet_vertical_resize_base/views/assets.xml
  9. 24
      website_mail_snippet_vertical_resize_base/views/snippets.xml

3
website_mail_snippet_responsive/__openerp__.py

@ -15,10 +15,9 @@
"images/snippets.png", "images/snippets.png",
], ],
"depends": [ "depends": [
"website_mail",
"website_mail_snippet_vertical_resize_base",
], ],
"data": [ "data": [
"views/assets.xml",
"views/templates.xml", "views/templates.xml",
"views/snippet_1_col.xml", "views/snippet_1_col.xml",
"views/snippet_2_cols.xml", "views/snippet_2_cols.xml",

12
website_mail_snippet_responsive/views/snippet_hr.xml

@ -7,18 +7,6 @@
<template id="snippet_hr" <template id="snippet_hr"
inherit_id="website_mail.email_designer_snippets"> 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>
<xpath expr="//div[@id='snippet_email_structure']"> <xpath expr="//div[@id='snippet_email_structure']">
<t t-call="website_mail_snippet_responsive.snippet"> <t t-call="website_mail_snippet_responsive.snippet">
<t t-set="image" t-value="'snippet_hr'"/> <t t-set="image" t-value="'snippet_hr'"/>

72
website_mail_snippet_vertical_resize_base/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
------
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
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
website_mail_snippet_vertical_resize_base/__init__.py

21
website_mail_snippet_vertical_resize_base/__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",
],
}

BIN
website_mail_snippet_vertical_resize_base/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

0
website_mail_snippet_responsive/static/src/js/vertical_resize.js → website_mail_snippet_vertical_resize_base/static/src/js/vertical_resize.js

2
website_mail_snippet_responsive/views/assets.xml → website_mail_snippet_vertical_resize_base/views/assets.xml

@ -8,7 +8,7 @@
<template id="assets_editor" inherit_id="website.assets_editor"> <template id="assets_editor" inherit_id="website.assets_editor">
<xpath expr="."> <xpath expr=".">
<script type="text/javascript" <script type="text/javascript"
src="/website_mail_snippet_responsive/static/src/js/vertical_resize.js"/>
src="/website_mail_snippet_vertical_resize_base/static/src/js/vertical_resize.js"/>
</xpath> </xpath>
</template> </template>

24
website_mail_snippet_vertical_resize_base/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>
Loading…
Cancel
Save