Comparing version 2.0.2rc1 to 2.0.3rc1
@@ -86,2 +86,7 @@ var jqtpl = require('./jqtpl'), | ||
options = _.defaults(options || {}, currentOptions); | ||
if (options.__isLayout) { | ||
options.__path = options.__parent.__path; | ||
} | ||
path = resolvePath(path, options); | ||
@@ -145,2 +150,3 @@ | ||
if (layoutPath) { | ||
options.__parent = _.clone(options); | ||
options.__isLayout = true; | ||
@@ -147,0 +153,0 @@ options.body = str; |
{ | ||
"name": "jqtpl", | ||
"description": "A template engine for nodejs, browser and any other javascript environment", | ||
"version": "2.0.2rc1", | ||
"version": "2.0.3rc1", | ||
"author": "Oleg Slobodskoi <oleg008@gmail.com>", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -111,2 +111,17 @@ var express = require('express'), | ||
test('load partial from layout using relative path', function() { | ||
expect(1); | ||
stop(); | ||
app.set('view options', {layout: '/layout2'}); | ||
app.set('views', options.root + '/2'); | ||
post('/views/test', {mylocal: "mylocal"}, function(data) { | ||
equal(data, 'abc partial', 'partial path resolved correctly'); | ||
app.disable('view options'); | ||
app.set('views', views); | ||
start(); | ||
}); | ||
}); | ||
test("render multiple times the same template #29", function() { | ||
@@ -113,0 +128,0 @@ var data; |
41980
20
900