[FIX] web_editor: image name
Add the image name in the website for SEO purpose. This is a backport of:88a5d9a000886c07dabb152e3f8686opw-1880472
This commit is contained in:
committed by
Nicolas Martinelli
parent
229c119999
commit
e673484b35
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user