summaryrefslogtreecommitdiff
path: root/addons/web_editor/views
diff options
context:
space:
mode:
authorSamuel Degueldre <sad@odoo.com>2020-05-19 09:21:49 +0000
committerqsm-odoo <qsm@odoo.com>2020-06-05 18:11:53 +0000
commitaa8d2a8be2c8f713b4b39b2aa1ea2aaf1839396c (patch)
treef1531840d7b262d1e282d14db23a3d0ce6d41571 /addons/web_editor/views
parentc2de755bc690987f59cda27bd83a7429278955fc (diff)
[IMP] web_editor, *: move image optimization feature to left-panel
*: website, mass_mailing In continuity with the nline crop, in an effort to make the image workflow as seamless as possible in the website editor, the image optimization feature has been moved out of the modal which could be opened through the media-dialog and into the left panel. This commit adds a quality slider and a width selector, as well as a preview of the image's weight to the left panel, and removes the image_optimize dialog. This commit also introduces the possibility to add a color filter on images. Part of https://github.com/odoo/odoo/pull/51517 task-2192755 closes odoo/odoo#51517 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/web_editor/views')
-rw-r--r--addons/web_editor/views/editor.xml2
-rw-r--r--addons/web_editor/views/snippets.xml18
2 files changed, 19 insertions, 1 deletions
diff --git a/addons/web_editor/views/editor.xml b/addons/web_editor/views/editor.xml
index 873e45d64c3..2c340c56c61 100644
--- a/addons/web_editor/views/editor.xml
+++ b/addons/web_editor/views/editor.xml
@@ -39,10 +39,10 @@
<script type="text/javascript" src="/web_editor/static/src/js/editor/editor.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/editor/rte.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/editor/rte.summernote.js"/>
+ <script type="text/javascript" src="/web_editor/static/src/js/editor/image_processing.js"/>
<!-- widgets & plugins -->
- <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/widgets/image_optimize_dialog.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/widgets/media.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/widgets/dialog.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/widgets/alt_dialog.js"/>
diff --git a/addons/web_editor/views/snippets.xml b/addons/web_editor/views/snippets.xml
index 91169152a6c..cbadd7fb7e7 100644
--- a/addons/web_editor/views/snippets.xml
+++ b/addons/web_editor/views/snippets.xml
@@ -37,6 +37,19 @@
</div>
</template>
+<template id="image_optimization_controls">
+ <we-range string="Quality" data-set-quality=""/>
+ <!-- Select filled in JS -->
+ <we-select string="Width" data-name="width_select_opt" data-no-preview="true"/>
+ <span class="o_we_image_weight text-right"/>
+ <we-colorpicker string="Color filter" data-set-filter="" data-no-preview="true" data-excluded="common, theme"/>
+ <div class="o_we_external_warning d-none">
+ <we-title title="Quality options are unavailable for external images. If you want to change this image's quality, please first download it from the original source and upload it in Odoo.">
+ <i class="fa fa-warning" /> External Image
+ </we-title>
+ </div>
+</template>
+
<!-- options (data-selector, data-drop-in, data-drop-near, data-js to link js object ) -->
<template id="snippet_options">
<!-- t-field -->
@@ -49,6 +62,11 @@
<div data-js="VersionControl"
data-selector="[data-snippet]"/>
+
+ <div data-js="ImageOptimize"
+ data-selector="img">
+ <t t-call="web_editor.image_optimization_controls"/>
+ </div>
</template>
<!-- default block -->