From c66885af516d2cd2268617c5984728cb912b1666 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 28 May 2013 14:11:27 -0400 Subject: [PATCH] fixing build_header misdef --- src/webserver.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/webserver.js b/src/webserver.js index 13e2d448c3..697eacd4ef 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -21,7 +21,10 @@ var express = require('express'), meta = require('./meta.js'); (function(app) { - var templates = null; + var templates = null, + build_header = function() { + return templates['header'].parse({ cssSrc: global.config['theme:src'] || '/vendor/bootstrap/css/bootstrap.min.css' }); + }; // Middlewares app.use(express.favicon()); // 2 args: string path and object options (i.e. expire time etc) @@ -72,10 +75,7 @@ var express = require('express'), // Basic Routes (entirely client-side parsed, goal is to move the rest of the crap in this file into this one section) (function() { - var routes = ['', 'login', 'register', 'account', 'latest', 'popular', 'active', '403', '404'], - build_header = function() { - return templates['header'].parse({ cssSrc: global.config['theme:src'] || '/vendor/bootstrap/css/bootstrap.min.css' }); - }; + var routes = ['', 'login', 'register', 'account', 'latest', 'popular', 'active', '403', '404']; for (var i=0, ii=routes.length; itemplates.ready(function(){ajaxify.go("topic/' + topic_url + '");});' + templates['footer']); + topics.get_cid_by_tid(req.params.topic_id, function() { + res.send( + build_header() + + '' + + '' + + templates['footer'] + ); + }); }); app.get('/category/:category_id/:slug?', function(req, res) {