summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/website.editor.js
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@openerp.com>2013-11-19 15:32:59 +0100
committerChristophe Matthieu <chm@openerp.com>2013-11-19 15:32:59 +0100
commit5e7a8a957c449e857b0fd3718331e7b094618732 (patch)
treee95f765141c87bdd2cfd16f124bdd182ef08e9ce /addons/website/static/src/js/website.editor.js
parent814ee75c4f566c9a893886ff8efb7226426d293d (diff)
[IMP] website editor: better rendering of the popover when failure write raise by except_osv.
bzr revid: chm@openerp.com-20131119143259-vm7o3vq79358h56w
Diffstat (limited to 'addons/website/static/src/js/website.editor.js')
-rw-r--r--addons/website/static/src/js/website.editor.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js
index 0dacbf0478e..30af6fdee04 100644
--- a/addons/website/static/src/js/website.editor.js
+++ b/addons/website/static/src/js/website.editor.js
@@ -513,16 +513,23 @@
if (!_.isArray(failed)) { failed = [failed]; }
_(failed).each(function (failure) {
+ var html = failure.error.exception_type === "except_osv";
+ if (html) {
+ var msg = $("<div/>").text(failure.error.message).html();
+ var data = msg.substring(3,msg.length-2).split(/', u'/);
+ failure.error.message = '<b>' + data[0] + '</b><br/>' + data[1];
+ }
$(root).find('.' + failure.id)
.removeClass(failure.id)
.popover({
+ html: html,
trigger: 'hover',
content: failure.error.message,
placement: 'auto top',
})
// Force-show popovers so users will notice them.
.popover('show');
- })
+ });
});
});
},