Skip to content

Node.js based forum software built for the modern web

committing the broken template parsing for andrew to see (webserver.js, line 121. Uncomment the commented out object, or substitute in "posts")

Julian Lam6df57c4a9b6a
diff --git a/public/templates/noscript/topic.tpl b/public/templates/noscript/topic.tpl
index a0b4445589..6e5684ea4d 100644
--- a/public/templates/noscript/topic.tpl
+++ b/public/templates/noscript/topic.tpl
@@ -9,7 +9,7 @@
<ul>
<!-- BEGIN posts -->
<li>
-
+ Foo: {posts.foo}
</li>
<!-- END posts -->
</ul>
\ No newline at end of file
diff --git a/src/webserver.js b/src/webserver.js
index 68d8126acb..8ba6590594 100644
--- a/src/webserver.js
+++ b/src/webserver.js
@@ -115,9 +115,10 @@ var express = require('express'),
var topic_url = tid + (req.params.slug ? '/' + req.params.slug : '');
topics.get_posts_noscript(tid, ((req.user) ? req.user.uid : 0), function(posts) {
+ console.log(posts);
res.send(
build_header() +
- '\n\t<noscript>\n\t\t' + templates['noscript/topic'] + '\n\t</noscript>' +
+ '\n\t<noscript>\n\t\t' + templates['noscript/topic'].parse(/*{ posts: [{ foo: 'bar' }]}*/) + '\n\t</noscript>' +
'\n\t<script>templates.ready(function(){ajaxify.go("topic/' + topic_url + '");});</script>' +
templates['footer']
);