From: Wolfram Schneider Date: Fri, 10 Jan 2014 16:18:36 +0000 (+0000) Subject: Merge branch 'master' of ssh://git.indexdata.com:222/home/git/private/mkws X-Git-Tag: 1.0.0~1718 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=eefc46271d6bb1c57317f657be87eaa6b5b08857;hp=f18d4ea782b37d8a56636f759ab0982bc6a5830f;p=mkws-moved-to-github.git Merge branch 'master' of ssh://git.indexdata.com:222/home/git/private/mkws --- diff --git a/examples/apache2/mkws-examples-mike b/examples/apache2/mkws-examples-mike index bf09873..9078c70 100644 --- a/examples/apache2/mkws-examples-mike +++ b/examples/apache2/mkws-examples-mike @@ -1,6 +1,7 @@ ServerName x.example.indexdata.com DocumentRoot /usr/local/src/git/mkws/examples/htdocs/ + Alias /tools/htdocs/ /usr/local/src/git/mkws/tools/htdocs/ ErrorLog /var/log/apache2/mkws-examples-error.log CustomLog /var/log/apache2/mkws-examples-access.log combined diff --git a/tools/apache2/mkws-live b/tools/apache2/mkws-live index e3ed207..35f396a 100644 --- a/tools/apache2/mkws-live +++ b/tools/apache2/mkws-live @@ -14,7 +14,7 @@ RewriteEngine on RewriteLogLevel 1 RewriteLog /var/log/apache2/mkws-rewrite.log - RewriteRule /service-proxy-auth /service-proxy/?command=auth&action=login&username=demo&password=demo [P] # [NE,P] + RewriteRule /service-proxy-auth /service-proxy/?command=auth&action=login&username=mkws&password=mkws [P] # [NE,P] # The following rule allows the server to accept service-proxy # requests that begin with an escaped "%3F" rather than a literal @@ -25,8 +25,8 @@ Header set Access-Control-Allow-Credentials true # For MKC Service Proxy - ProxyPass /service-proxy/ http://mk2-test.indexdata.com/service-proxy/ - ProxyPassReverse /service-proxy/ http://mk2-test.indexdata.com/service-proxy/ + ProxyPass /service-proxy/ http://mkc.indexdata.com:9009/service-proxy/ + ProxyPassReverse /service-proxy/ http://mkc.indexdata.com:9009/service-proxy/ PerlOptions +Parent PerlSwitches -I/home/indexdata/mkws/tools/mod_perl diff --git a/tools/htdocs/NEWS b/tools/htdocs/NEWS index fc11797..5bbb6ad 100644 --- a/tools/htdocs/NEWS +++ b/tools/htdocs/NEWS @@ -6,6 +6,10 @@ Version history for the MasterKey Widget Set (MKWS) The 0.9.x series of releases are beta quality. They are functional but have not yet been extensively battle-tested. +0.9.2 [IN PROGRESS] + - Full-record template invokes {{translate}} on fieldnames. + Fixes MKWS-84 Translate fieldnames in full-record popup. + 0.9.1 Thu Dec 19 15:33:13 GMT 2013 - First public release. 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}}\