diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2014-06-04 14:21:12 +0600 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2014-06-04 14:21:12 +0600 |
commit | 6b66aa3eb6ff94d206090128a31acf8a264cec06 (patch) | |
tree | 30f5e8eb2077cf02c45d4b1c0ca7cd3a0d637f40 /sonar-server/src/main/js/common/handlebars-extensions.js | |
parent | ca4f0a47bc7e60bbcc74f05e495cad95eaee7a09 (diff) | |
download | sonarqube-6b66aa3eb6ff94d206090128a31acf8a264cec06.tar.gz sonarqube-6b66aa3eb6ff94d206090128a31acf8a264cec06.zip |
SONAR-5209 Fix issue comments
Diffstat (limited to 'sonar-server/src/main/js/common/handlebars-extensions.js')
-rw-r--r-- | sonar-server/src/main/js/common/handlebars-extensions.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sonar-server/src/main/js/common/handlebars-extensions.js b/sonar-server/src/main/js/common/handlebars-extensions.js index b893a35a513..b088af5e282 100644 --- a/sonar-server/src/main/js/common/handlebars-extensions.js +++ b/sonar-server/src/main/js/common/handlebars-extensions.js @@ -61,6 +61,17 @@ define(['handlebars', 'moment'], function (Handlebars, moment) { return value != null ? value : defaultValue; }); + Handlebars.registerHelper('show', function() { + var args = Array.prototype.slice.call(arguments), + ret = null; + args.forEach(function(arg) { + if (arg != null && ret == null) { + ret = arg; + } + }); + return ret; + }); + Handlebars.registerHelper('percent', function(value, total) { return '' + ((value || 0) / total * 100) + '%'; }); |