Add 'attr' Handlebars helper.
authorMike Taylor <mike@indexdata.com>
Thu, 28 Nov 2013 15:06:36 +0000 (15:06 +0000)
committerMike Taylor <mike@indexdata.com>
Thu, 28 Nov 2013 15:06:36 +0000 (15:06 +0000)
We need {{attr name}} because Handlebars can't parse {{@@name}}

tools/htdocs/mkws.js

index 674bfff..43b2204 100644 (file)
@@ -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 + "'");