Commits

Anonymous committed 609c7ad

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.

Comments (0)

Files changed (3)

examples/docroot/path1/base1

-{% extends "../path2/base2" %}
+{% extends "path2/base2" %}
 
 {% block title2 %}block title 2 from  base1 {% endblock %}
 

examples/docroot/path1/template1

 
 {{ test_var }}
 
-{% include "../path2/template2" %}
+{% include "path2/template2" %}

src/erlydtl/erlydtl_compiler.erl

                     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        
     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.