mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-22 08:20:36 +01:00
fixed serverside templates.js bug that prevented blocks from being defined
This commit is contained in:
@@ -210,7 +210,7 @@
|
|||||||
data = template.match(regex);
|
data = template.match(regex);
|
||||||
if (data == null) return;
|
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]
|
data = data[0]
|
||||||
.replace("<!-- BEGIN " + block + " -->", "")
|
.replace("<!-- BEGIN " + block + " -->", "")
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ var express = require('express'),
|
|||||||
console.log(posts);
|
console.log(posts);
|
||||||
res.send(
|
res.send(
|
||||||
build_header() +
|
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>' +
|
'\n\t<script>templates.ready(function(){ajaxify.go("topic/' + topic_url + '");});</script>' +
|
||||||
templates['footer']
|
templates['footer']
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user