From 3e41dc74725405888c8ddbaddb452971536cea14 Mon Sep 17 00:00:00 2001 From: Nathan Bowser Date: Thu, 4 Oct 2012 15:58:19 -0400 Subject: [PATCH] Upgrades for express 3.x --- lib/http/index.js | 4 ++-- lib/http/views/job/list.jade | 17 ++++++++++------- lib/http/views/layout.jade | 17 ++++++++++------- package.json | 2 +- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/lib/http/index.js b/lib/http/index.js index d4d38f59..15afde84 100644 --- a/lib/http/index.js +++ b/lib/http/index.js @@ -13,7 +13,7 @@ var express = require('express'); // setup -var app = express.createServer() +var app = express() , provides = require('./middleware/provides') , stylus = require('stylus') , routes = require('./routes') @@ -39,7 +39,7 @@ app.set('view options', { doctype: 'html' }); app.set('view engine', 'jade'); app.set('views', __dirname + '/views'); app.set('title', 'Kue'); -app.helpers({ inspect: util.inspect }); +app.locals({ inspect: util.inspect }) // middleware diff --git a/lib/http/views/job/list.jade b/lib/http/views/job/list.jade index 73b603af..8b76f664 100644 --- a/lib/http/views/job/list.jade +++ b/lib/http/views/job/list.jade @@ -1,10 +1,13 @@ -h1 #{state} +extends ../layout -script - o(function(){ - init('#{state}'); - }); +block body + h1 #{state} + script + o(function(){ + init('#{state}'); + }); -#jobs -#loading: canvas(width=50, height=50) + + #jobs + #loading: canvas(width=50, height=50) diff --git a/lib/http/views/layout.jade b/lib/http/views/layout.jade index 6d377e88..9dfd6244 100644 --- a/lib/http/views/layout.jade +++ b/lib/http/views/layout.jade @@ -12,12 +12,15 @@ html script(src='./javascripts/search.js') script(src='./javascripts/main.js') body - != partial('menu') + include _menu #actions - != partial('search') - != partial('filter') - != partial('sort') - #content!= body - script(type='text/template')#job-template!= partial('job') - script(type='text/template')#row-template!= partial('row') + include _search + include _filter + include _sort + #content + block body + script(type='text/template')#job-template + include _job + script(type='text/template')#row-template + include _row #error diff --git a/package.json b/package.json index d0ac8f1e..b51ac315 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ , "author": "TJ Holowaychuk " , "dependencies": { "redis": "0.7.2" - , "express": "2.5.11" + , "express": "3.0.0rc5" , "jade": "0.26.3" , "stylus": "0.27.2" , "nib": "0.5.0"