Permalink
Browse files

Issue #11

Rolled back the functionality added in r152 (Issue #9).
The idea of an auto-changing template root folder is going away 
because it is not the "Django way".  The Djnago way is to have
all include paths relative to a base folder (although they do
support many base folders, but I digress).

Trying to support both systems is too complex and introduces unnecessary
ambiguity about the current include path for those doing it the Django way.
  • Loading branch information...
1 parent 4d43244 commit 61e3c4503218e7af1b8cedf9f76b323566a3cb21 @gardenia gardenia committed Mar 31, 2009
Showing with 4 additions and 6 deletions.
  1. +1 −1 examples/docroot/path1/base1
  2. +1 −1 examples/docroot/path1/template1
  3. +2 −4 src/erlydtl/erlydtl_compiler.erl
@@ -1,4 +1,4 @@
-{% extends "../path2/base2" %}
+{% extends "path2/base2" %}
{% block title2 %}block title 2 from base1 {% endblock %}
@@ -2,4 +2,4 @@ This is template 1.
{{ test_var }}
-{% include "../path2/template2" %}
+{% include "path2/template2" %}
@@ -293,8 +293,7 @@ body_ast([{extends, {string_literal, _Pos, String}} | ThisParseTree], Context, T
with_dependency({File, CheckSum}, body_ast(ParentParseTree, Context#dtl_context{
block_dict = dict:merge(fun(_Key, _ParentVal, ChildVal) -> ChildVal end,
BlockDict, Context#dtl_context.block_dict),
- parse_trail = [File | Context#dtl_context.parse_trail],
- doc_root = filename:dirname(File)}, TreeWalker));
+ parse_trail = [File | Context#dtl_context.parse_trail]}, TreeWalker));
Err ->
throw(Err)
end
@@ -450,8 +449,7 @@ include_ast(File, Context, TreeWalker) ->
case parse(FilePath, Context) of
{ok, InclusionParseTree, CheckSum} ->
with_dependency({FilePath, CheckSum}, body_ast(InclusionParseTree, Context#dtl_context{
- parse_trail = [FilePath | Context#dtl_context.parse_trail],
- doc_root = filename:dirname(FilePath) }, TreeWalker));
+ parse_trail = [FilePath | Context#dtl_context.parse_trail]}, TreeWalker));
Err ->
throw(Err)
end.

0 comments on commit 61e3c45

Please sign in to comment.