<html>
<body>
<acre:script>
var APP_EDITOR = 'http://localhost/acrid/'; /* TODO: how to abstract this? */
function basename(path) {
return path.replace( /.*\//, "" );
}
function dirname(path) {
return path.match( /(.*)\// )[1];
}
var query = acre.require("freebase:/user/willmoffat/test-args/testcases").query;
/* query = acre.freebase.extend_query(query, {"location.id":"/en/berkeley_california", "limit":10}); */
var testcases = acre.freebase.MqlRead(query).result;
</acre:script>
<div acre:def="highlight_ids(test_path)" acre:strip="1">
${test_path.replace(/&/g,'<b>&</b>')}
</div>
<h3>Output</h3>
<div>
<div acre:for="testcase in testcases">
<a href="${APP_EDITOR + '#app=' + dirname(testcase.file.id) + '&file=' + basename(testcase.file.id) + '&tab=edit' }">
${testcase.file.name || testcase.file.id}
</a>
-
${highlight_ids(testcase.test_path)}
</div>
</div>
<!-- Attribution -->
<acre:script>
var attribution = acre.require("freebase:/freebase/apps/attribution/templates");
</acre:script>
${attribution.blanket()}
</body>
</html>