Skip to content

Commit

Permalink
Issue #11
Browse files Browse the repository at this point in the history
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
gardenia committed Mar 31, 2009
1 parent 4d43244 commit 61e3c45
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/docroot/path1/base1
@@ -1,4 +1,4 @@
{% extends "../path2/base2" %}
{% extends "path2/base2" %}

{% block title2 %}block title 2 from base1 {% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion examples/docroot/path1/template1
Expand Up @@ -2,4 +2,4 @@ This is template 1.

{{ test_var }}

{% include "../path2/template2" %}
{% include "path2/template2" %}
6 changes: 2 additions & 4 deletions src/erlydtl/erlydtl_compiler.erl
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 61e3c45

Please sign in to comment.