From a1d319a8fb889689bb0a6c6eb5ce158f70bd1126 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 12 Mar 2015 11:05:50 +0100 Subject: [PATCH] [FIX] Web: view_list.js: _.template() The signature and behavior of function template() of underscore.js has been changed from rev. 1.7.0. It doesn't accept an initial data object anymore, and always returns a function. This commits adapts our calls to _.template(). This fixes display bugs in list views (e.g. the progressbar which was not displayed). --- addons/web/static/src/js/view_list.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 97c4abda05f..678d1684073 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -2327,7 +2327,7 @@ instance.web.list.Binary = instance.web.list.Column.extend({ text = _.str.sprintf(_t("Download \"%s\""), instance.web.format_value( row_data[this.filename].value, {type: 'char'})); } - return _.template('<%-text%> (<%-size%>)', { + return _.template('<%-text%> (<%-size%>)')({ text: text, href: download_url, size: instance.web.binary_to_binsize(value), @@ -2356,7 +2356,7 @@ instance.web.list.ProgressBar = instance.web.list.Column.extend({ */ _format: function (row_data, options) { return _.template( - '<%-value%>%', { + '<%-value%>%')({ value: _.str.sprintf("%.0f", row_data[this.id].value || 0) }); } @@ -2427,7 +2427,7 @@ instance.web.list.Url = instance.web.list.Column.extend({ var value = row_data[this.id].value; if (value) { - return _.template("<%-text%>", { + return _.template("<%-text%>")({ href: value.trim().replace(this.PROTOCOL_REGEX, '//'), text: value });