Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] web_editor: allow adding a shape-on-image via custom URL (themes)
The goal of this commit is to add a "Python version" of the shape-on-image feature using a controller. Since the whole logic to apply shapes on image is JS-based, we need to use this URL (just like for background shapes) when we want to add a shape by default on images in themes. When the configurator replaces a snippet image (which the theme defines to have a shape), the shape option should still be applied on the new image. On the JS side, loadImageInfo() is overridden in order to mark images (with theme default shapes) with corresponding attachment data (original-id, original-src, mimetype). Here is an example of the minimum xpath required to add a shape on a snippet image in a theme: ``` <template id="s_image_text" inherit_id="website.s_image_text"> <xpath expr="//img" position="attributes"> <attribute name="src">/web_editor/image_shape/website.s_image_text_default_image/web_editor/solid/blob_1_solid_rd.svg?c2=o-color-1</attribute> <attribute name="data-shape">web_editor/solid/blob_1_solid_rd</attribute> <attribute name="data-original-mimetype">image/jpeg</attribute> <attribute name="data-file-name">s_image_text.svg</attribute> <attribute name="data-shape-colors">;o-color-1;;;</attribute> </xpath> </template> ``` task-2593454 closes #73938 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
- Loading branch information
Showing
3 changed files
with
120 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters