From: Mike Taylor Date: Thu, 28 Nov 2013 15:06:36 +0000 (+0000) Subject: Add 'attr' Handlebars helper. X-Git-Tag: 0.9.1~148^2~26 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=5351e6e2408da4b142249cbe356fe972546bff51;p=mkws-moved-to-github.git Add 'attr' Handlebars helper. We need {{attr name}} because Handlebars can't parse {{@@name}} --- diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 674bfff..43b2204 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -118,6 +118,12 @@ Handlebars.registerHelper('json', function(obj) { }); +// We need {{attr name}} because Handlebars can't parse {{@@name}} +Handlebars.registerHelper('attr', function(attrName) { + return this['@' + attrName]; +}); + + Handlebars.registerHelper('first', function(items, options) { var having = options.hash.having; debug("#first checking for first item having '" + having + "'");