X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=tools%2Fhtdocs%2Fmkws.js;h=cacc8d0825eb4b4c0a69b439d4c8b7736107903e;hb=fc4a1ad25e262aae42c2c368b275610a2c3ffd26;hp=ef156877506af8d158a5712f1e4f1eb2ba0a085d;hpb=44f9694f200809e6c5cd7811988aa8e97c5917ac;p=mkws-moved-to-github.git diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index ef15687..cacc8d0 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -108,6 +108,12 @@ Handlebars.registerHelper('json', function(obj) { }); +Handlebars.registerHelper('translate', function(s) { + debug("translating '" + s + "'"); + return M(s); +}); + + // We need {{attr '@name'}} because Handlebars can't parse {{@name}} Handlebars.registerHelper('attr', function(attrName) { return this[attrName]; @@ -782,7 +788,7 @@ function defaultTemplate(name) return '\ \ \ - \ + \ \ {{#if md-date}}\ \ - \ + \ \ \ {{/if}}\ {{#if md-author}}\ \ - \ + \ \ \ {{/if}}\ {{#if md-electronic-url}}\ \ - \ + \ \ - \ + \ \ {{/if-any}}\ \ - \ + \
Title{{translate "Title"}}\ {{md-title}}\ {{#if md-title-remainder}}\ @@ -795,19 +801,19 @@ function defaultTemplate(name)
Date{{translate "Date"}}{{md-date}}
Author{{translate "Author"}}{{md-author}}
URL{{translate "URL"}}\ {{#each md-electronic-url}}\ {{this}}
\ @@ -817,7 +823,7 @@ function defaultTemplate(name) {{/if}}\ {{#if-any location having="md-subject"}}\
Subject{{translate "Subject"}}\ {{#first location having="md-subject"}}\ {{#if md-subject}}\ @@ -828,7 +834,7 @@ function defaultTemplate(name)
Locations{{translate "Locations"}}\ {{#commaList location}}\ {{attr "@name"}}{{/commaList}}\