Browse Source

aded test for call tag

git-svn-id: http://erlydtl.googlecode.com/svn/trunk@105 a5195066-8e3e-0410-a82a-05b01b1b9875
rsaccon 17 years ago
parent
commit
718265c7ff

+ 18 - 0
demo/out/test_custom_call.html

@@ -0,0 +1,18 @@
+>>>> before custom call tag
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>Test Comment</title>								 
+  </head>
+  <body>
+	
+	bla
+	
+        blue
+        
+        black
+  </body>
+</html>
+
+>>>> after custom call tag

+ 0 - 0
demo/out/test_custom_tags.html → demo/out/test_custom_tag.html


+ 3 - 0
demo/templates/test_custom_call.html

@@ -0,0 +1,3 @@
+>>>> before custom call tag
+{% call test_comment %}
+>>>> after custom call tag

+ 0 - 0
demo/templates/test_custom_tags.html → demo/templates/test_custom_tag.html


+ 0 - 0
demo/templates/test_custom_tags_error.html → demo/templates/test_custom_tag_error.html


+ 16 - 8
src/demo/erlydtl_demo.erl

@@ -69,8 +69,6 @@ create_parser() ->
 compile_all() ->
     compile("autoescape"),
     compile("comment"),
-    compile("custom_tags"),
-    compile("custom_tags_error"),
     compile("extends"),
     compile("filters"),
     compile("for"),
@@ -89,7 +87,10 @@ compile_all() ->
     compile("include"),
     compile("var"),
     compile("var_preset"),
-    compile("var_error").
+    compile("var_error"),
+    compile("custom_tag"),
+    compile("custom_tag_error"),
+    compile("custom_call").
 
 
 %%--------------------------------------------------------------------
@@ -171,12 +172,15 @@ compile("for_records_preset" = Name) ->
     Var = [{software_links, [Link1, Link2, Link3]}],
     compile(Name, ".html", Var);
     
-compile("custom_tags" = Name) ->
+compile("custom_tag" = Name) ->
     compile(Name, ".html", []);
 
-compile("custom_tags_error" = Name) ->
+compile("custom_tag_error" = Name) ->
     compile(Name, ".html", []);
                   
+compile("custom_call" = Name) ->
+    compile(Name, ".html", []);
+        
 compile(Name) ->
     io:format("No such template: ~p~n",[Name]).
                
@@ -212,7 +216,6 @@ compile(Name, Ext, Vars) ->
 render_all() ->
     render("autoescape"),
     render("comment"),
-    render("custom_tags"),
     render("extends"),
     render("filters"),
     render("for"),
@@ -231,7 +234,9 @@ render_all() ->
     render("include"),
     render("var"),
     render("var_preset"),
-    render("var_error").
+    render("var_error"),
+    render("custom_tag"),
+    render("custom_call").
         
 
 %%--------------------------------------------------------------------
@@ -310,9 +315,12 @@ render("var_preset" = Name) ->
 render("var_error" = Name) ->
     render(Name, [{var1, "foostring1"}]);
         
-render("custom_tags" = Name) ->
+render("custom_tag" = Name) ->
     render(Name, []);
                 
+render("custom_call" = Name) ->
+    render(Name, []);
+                    
 render(Name) ->
     io:format("No such template: ~p~n",[Name]).