projects
/
mkws-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
536650f
)
Add 'attr' Handlebars helper.
author
Mike Taylor
<mike@indexdata.com>
Thu, 28 Nov 2013 15:06:36 +0000
(15:06 +0000)
committer
Mike 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
patch
|
blob
|
history
diff --git
a/tools/htdocs/mkws.js
b/tools/htdocs/mkws.js
index
674bfff
..
43b2204
100644
(file)
--- 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 + "'");