3
0
Fork 0

[MIG] web_editor_background_color: Migration to v13

13.0
Carlos Roca 2020-11-05 13:18:19 +01:00
parent ebd0ba3ca3
commit b6afb1bc14
15 changed files with 51 additions and 35 deletions

View File

@ -0,0 +1 @@
../../../../web_editor_background_color

View File

@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

View File

@ -14,13 +14,13 @@ Web Editor Background Color Picker
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3 :alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/12.0/web_editor_background_color :target: https://github.com/OCA/web/tree/13.0/web_editor_background_color
:alt: OCA/web :alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_editor_background_color :target: https://translation.odoo-community.org/projects/web-13-0/web-13-0-web_editor_background_color
:alt: Translate me on Weblate :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/162/12.0 :target: https://runbot.odoo-community.org/runbot/162/13.0
:alt: Try me on Runbot :alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5| |badge1| |badge2| |badge3| |badge4| |badge5|
@ -28,8 +28,8 @@ Web Editor Background Color Picker
This module extends the functionality of the web editor to support This module extends the functionality of the web editor to support
setting a custom background color to any snippet allowing you to customize it. setting a custom background color to any snippet allowing you to customize it.
.. figure:: https://user-images.githubusercontent.com/973709/46802401-1c915180-cd55-11e8-9397-f198548a690c.gif .. figure:: https://user-images.githubusercontent.com/35952655/98240459-bb56ff00-1f69-11eb-8e71-ee4aa1533f67.gif
:alt: Screenshot of color picker in mass mailing editor :alt: Screenshot of color picker in website editor
**Table of contents** **Table of contents**
@ -65,7 +65,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_. Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
In case of trouble, please check there if your issue has already been reported. 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 If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_editor_background_color%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. `feedback <https://github.com/OCA/web/issues/new?body=module:%20web_editor_background_color%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues. Do not contact contributors directly about support or help with technical issues.
@ -80,7 +80,10 @@ Authors
Contributors Contributors
~~~~~~~~~~~~ ~~~~~~~~~~~~
* Jairo Llopis <jairo.llopis@tecnativa.com> - https://www.tecnativa.com * `Tecnativa <https://www.tecnativa.com>`_:
* Jairo Llopis
* Carlos Roca
Other credits Other credits
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
@ -102,6 +105,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use. promote its widespread use.
This module is part of the `OCA/web <https://github.com/OCA/web/tree/12.0/web_editor_background_color>`_ project on GitHub. This module is part of the `OCA/web <https://github.com/OCA/web/tree/13.0/web_editor_background_color>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -1,9 +1,9 @@
# Copyright 2017 Jairo Llopis <jairo.llopis@tecnativa.com> # Copyright 2017 Tecnativa - Jairo Llopis
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{ {
"name": "Web Editor Background Color Picker", "name": "Web Editor Background Color Picker",
"summary": "Set any background color for web editor snippets", "summary": "Set any background color for web editor snippets",
"version": "12.0.1.0.0", "version": "13.0.1.0.0",
"category": "Website", "category": "Website",
"website": "https://github.com/OCA/web", "website": "https://github.com/OCA/web",
"author": "Tecnativa, Odoo Community Association (OCA)", "author": "Tecnativa, Odoo Community Association (OCA)",

View File

@ -18,5 +18,3 @@ msgstr ""
"Content-Transfer-Encoding: \n" "Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#~ msgid "Color"
#~ msgstr "Color"

View File

@ -17,5 +17,3 @@ msgstr ""
"Plural-Forms: \n" "Plural-Forms: \n"
"X-Generator: Poedit 1.8.6\n" "X-Generator: Poedit 1.8.6\n"
#~ msgid "Pick Background Color"
#~ msgstr "Escoger el color de fondo"

View File

@ -19,5 +19,3 @@ msgstr ""
"Content-Transfer-Encoding: \n" "Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
#~ msgid "Pick Background Color"
#~ msgstr "Mettre la couleur de fond"

View File

@ -20,5 +20,3 @@ msgstr ""
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3);\n" "%100==4 ? 2 : 3);\n"
#~ msgid "Pick Background Color"
#~ msgstr "Izbira barve ozadja"

View File

@ -1 +1,4 @@
* Jairo Llopis <jairo.llopis@tecnativa.com> - https://www.tecnativa.com * `Tecnativa <https://www.tecnativa.com>`_:
* Jairo Llopis
* Carlos Roca

View File

@ -1,5 +1,5 @@
This module extends the functionality of the web editor to support This module extends the functionality of the web editor to support
setting a custom background color to any snippet allowing you to customize it. setting a custom background color to any snippet allowing you to customize it.
.. figure:: https://user-images.githubusercontent.com/973709/46802401-1c915180-cd55-11e8-9397-f198548a690c.gif .. figure:: https://user-images.githubusercontent.com/35952655/98240459-bb56ff00-1f69-11eb-8e71-ee4aa1533f67.gif
:alt: Screenshot of color picker in mass mailing editor :alt: Screenshot of color picker in website editor

View File

@ -367,11 +367,11 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/12.0/web_editor_background_color"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_editor_background_color"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/13.0/web_editor_background_color"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-13-0/web-13-0-web_editor_background_color"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module extends the functionality of the web editor to support <p>This module extends the functionality of the web editor to support
setting a custom background color to any snippet allowing you to customize it.</p> setting a custom background color to any snippet allowing you to customize it.</p>
<div class="figure"> <div class="figure">
<img alt="Screenshot of color picker in mass mailing editor" src="https://user-images.githubusercontent.com/973709/46802401-1c915180-cd55-11e8-9397-f198548a690c.gif" /> <img alt="Screenshot of color picker in website editor" src="https://user-images.githubusercontent.com/35952655/98240459-bb56ff00-1f69-11eb-8e71-ee4aa1533f67.gif" />
</div> </div>
<p><strong>Table of contents</strong></p> <p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents"> <div class="contents local topic" id="contents">
@ -417,7 +417,7 @@ module will no longer be needed.</li>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>. <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported. 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 If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_editor_background_color%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_editor_background_color%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
@ -431,7 +431,11 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<div class="section" id="contributors"> <div class="section" id="contributors">
<h2><a class="toc-backref" href="#id6">Contributors</a></h2> <h2><a class="toc-backref" href="#id6">Contributors</a></h2>
<ul class="simple"> <ul class="simple">
<li>Jairo Llopis &lt;<a class="reference external" href="mailto:jairo.llopis&#64;tecnativa.com">jairo.llopis&#64;tecnativa.com</a>&gt; - <a class="reference external" href="https://www.tecnativa.com">https://www.tecnativa.com</a></li> <li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>Jairo Llopis</li>
<li>Carlos Roca</li>
</ul>
</li>
</ul> </ul>
</div> </div>
<div class="section" id="other-credits"> <div class="section" id="other-credits">
@ -447,7 +451,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use.</p> promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/12.0/web_editor_background_color">OCA/web</a> project on GitHub.</p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/13.0/web_editor_background_color">OCA/web</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div> </div>
</div> </div>

View File

@ -1,10 +1,10 @@
/* Copyright 2017-2019 Jairo Llopis <jairo.llopis@tecnativa.com> /* Copyright 2017-2019 Tecnativa - Jairo Llopis
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */ * License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
.snippet-option-colorpicker { .snippet-option-colorpicker {
.o_colorpicker_section[data-name="custom"] > .text-muted { .o_colorpicker_section[data-name="custom"] > #add-color {
cursor: pointer; cursor: pointer;
border-radius: 5px; border-radius: 2px;
&:hover { &:hover {
background-color: gray("400"); background-color: gray("400");

View File

@ -1,9 +1,9 @@
/* Copyright 2016-2019 Jairo Llopis <jairo.llopis@tecnativa.com> /* Copyright 2016-2019 Tecnativa - Jairo Llopis
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */ * License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
odoo.define("web_editor_background_color.colorpicker", function(require) { odoo.define("web_editor_background_color.colorpicker", function(require) {
"use strict"; "use strict";
var ColorpickerDialog = require("web.colorpicker"); var ColorpickerDialog = require("web.ColorpickerDialog");
var options = require("web_editor.snippets.options"); var options = require("web_editor.snippets.options");
var colorpicker = options.registry.colorpicker; var colorpicker = options.registry.colorpicker;
@ -12,7 +12,7 @@ odoo.define("web_editor_background_color.colorpicker", function(require) {
"colorpicker:saved": "_onCustomColorSave", "colorpicker:saved": "_onCustomColorSave",
}), }),
events: _.extend({}, colorpicker.prototype.events, { events: _.extend({}, colorpicker.prototype.events, {
"click .o_colorpicker_section[data-name=custom]>.text-muted": "click .o_colorpicker_section[data-name=custom]> #add-color":
"_onCustomColorAsk", "_onCustomColorAsk",
}), }),

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2017-2019 Jairo Llopis <jairo.llopis@tecnativa.com> <!-- Copyright 2017-2019 Tecnativa - Jairo Llopis
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). --> License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). -->
<odoo> <odoo>
<template id="assets_editor" inherit_id="web_editor.assets_editor"> <template id="assets_common" inherit_id="web_editor.assets_common">
<xpath expr="."> <xpath expr=".">
<link <link
rel="stylesheet" rel="stylesheet"

View File

@ -8,7 +8,14 @@
class="o_colorpicker_section" class="o_colorpicker_section"
data-name="custom" data-name="custom"
data-display="Custom Color" data-display="Custom Color"
/> style="position: relative;"
>
<span
id="add-color"
class="fa fa-plus"
style="position: absolute; right: 2px; top: 0px;"
/>
</div>
</xpath> </xpath>
</template> </template>
</data> </data>