diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2018-09-04 15:35:04 +0200 |
|---|---|---|
| committer | Nicolas Martinelli <nim-odoo@users.noreply.github.com> | 2018-09-05 09:42:10 +0200 |
| commit | e673484b35bc2f36aae3c4957925aa0eef4ac0df (patch) | |
| tree | e26984f08de5a3e4e3798bafe3d0f2b4107547ed /addons/web_editor/static/src/js | |
| parent | 229c119999467ed770b0813b577d93d649079998 (diff) | |
[FIX] web_editor: image name
Add the image name in the website for SEO purpose. This is a backport
of:
88a5d9a0000a5ea43afdc00ed
886c07dabb636767b80abb849
152e3f8686ec4f48ba22e5c13
opw-1880472
Diffstat (limited to 'addons/web_editor/static/src/js')
| -rw-r--r-- | addons/web_editor/static/src/js/widgets.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js index dc347c61690..a3a990a7baf 100644 --- a/addons/web_editor/static/src/js/widgets.js +++ b/addons/web_editor/static/src/js/widgets.js @@ -390,7 +390,7 @@ var ImageDialog = Widget.extend({ $form.find('.well > span').remove(); $form.find('.well > div').show(); _.each(attachments, function (record) { - record.src = record.url || '/web/image/' + record.id; + record.src = record.url || _.str.sprintf('/web/image/%s/%s', record.id, encodeURI(record.name)); // Name is added for SEO purposes record.is_document = !(/gif|jpe|jpg|png/.test(record.mimetype)); }); if (error || !attachments.length) { @@ -447,7 +447,7 @@ var ImageDialog = Widget.extend({ return (r.url || r.id); }); _.each(this.records, function (record) { - record.src = record.url || '/web/image/' + record.id; + record.src = record.url || _.str.sprintf('/web/image/%s/%s', record.id, encodeURI(record.name)); // Name is added for SEO purposes record.is_document = !(/gif|jpe|jpg|png/.test(record.mimetype)); }); this.display_attachments(); |
