[FIX] web_editor, website: permit the user to set link on images

This restores a (basic) feature that was lost in 15.0 by mistake.

Allow the user to set a link on an image. The user can access this link
tool in the editor panel or via the CTRL+K shortcut. This tool is very
similar to the existing link tool for texts. This tool uses the
suggestion system already existing on the text link tool.

task-2666467

closes odoo/odoo#82512

X-original-commit: bfcd25c5d66765b7436114dba3316ac7331a4d97
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
This commit is contained in:
Guillaume (gdi)
2022-01-11 14:27:00 +00:00
co-authored by qsm-odoo
parent 5957cad422
commit 7c8323e816
6 changed files with 305 additions and 1 deletions
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<templates id="template" xml:space="preserve">
<t t-name="web_editor.media_link_tools_button">
<we-button class="fa fa-link"
data-name="media_link_opt"
data-set-link="true" data-no-preview="true"
title="Redirect the user elsewhere when he clicks on the media."/>
</t>
<t t-name="web.editor.media_link_tools_fields">
<t t-set="url_input_label">⌙ Your URL</t>
<we-input t-att-string="url_input_label"
data-name="media_url_opt" data-dependencies="media_link_opt"
data-set-url="" data-no-preview="true"
class="o_we_large" placeholder="www.example.com"
data-request-focus="true"/>
<t t-set="new_window_checkbox_label">⌙ Open in new window</t>
<we-checkbox t-att-string="new_window_checkbox_label"
data-dependencies="media_url_opt"
data-set-new-window="true" data-no-preview="true"/>
</t>
</templates>