fixed serverside templates.js bug that prevented blocks from being defined

v1.18.x
psychobunny 12 years ago
parent 42e40e62d3
commit d5f3f3d9fb

@ -210,7 +210,7 @@
data = template.match(regex);
if (data == null) return;
if (block !== undefined) self.blocks[block] = data[0];
if (self.blocks && block !== undefined) self.blocks[block] = data[0];
data = data[0]
.replace("<!-- BEGIN " + block + " -->", "")

@ -118,7 +118,7 @@ var express = require('express'),
console.log(posts);
res.send(
build_header() +
'\n\t<noscript>\n\t\t' + templates['noscript/topic'].parse(/*{ posts: [{ foo: 'bar' }]}*/) + '\n\t</noscript>' +
'\n\t<noscript>\n\t\t' + templates['noscript/topic'].parse({ posts: posts }) + '\n\t</noscript>' +
'\n\t<script>templates.ready(function(){ajaxify.go("topic/' + topic_url + '");});</script>' +
templates['footer']
);

Loading…
Cancel
Save