<% c++ #include "tests/tc_test_content.h" %>
<% skin tc_skin %>
<% view test_default_master uses data::master %>
<% template render() %>c<% end template %>
<% end view %>
<% view view_y uses data::master %>
<% template render() %>view y<% end template %>
<% end view %>
<% view view_x uses data::master %>
<% template render() %>view x<% end template %>
<% end view %>
<% view master uses data::master %>
<% template render() %>
TBD
<% end template %>
<% end view %>

<% view master_tmpl uses data::master %>
<% template a() %>A<% end %>
<% template b(int x) %>x=<%= x %><% end %>
<% template c(int x,std::string const &y) %>x=<%=x%> y=<%=y%><% end %>
<% template d(int x,int y) %>x=<%= x %> r=<%= y %><% end %>
<% template render() %>
<% include a() %>
<% include b(10) %>
<% include b(integer) %>
<% include c(10,"test") %>
<% include c(integer,text) %>
<% end template %>
<% end view %>
<% view foreach_tmpl uses data::master %>
<% template auto_test() %>
<% c++ #ifdef __GNUC__ %>
<% foreach x in integers %><% item %><%= x %><% end %><%end%>
<% foreach x reverse in integers %><% item %><%= x %><% end %><%end%>
<% c++ #endif %>
<% end template %>
<% template render() %><% c++ typedef data::master::integers_type::iterator it; typedef data::master::integers_type::reverse_iterator rit;  %>
<% foreach x as it in integers %>{<% separator %>,<% item %><%= x %><% end %>}<%empty%>-<% end %>
<% foreach x as rit reverse in integers %>{<% separator %>,<% item %><%= x %><% end %>}<%empty%>-<% end %>
<% foreach x as it rowid y in integers %>{<% separator %>,<% item %><%= x %> <%= y %><% end %>}<%empty%>-<% end %>
<% foreach x as rit rowid y reverse in integers %>{<% separator %>,<% item %><%= x %> <%= y %><% end %>}<%empty%>-<% end %>
<% foreach x as it rowid y from 1 in integers %>{<% separator %>,<% item %><%= x %> <%= y %><% end %>}<%empty%>-<% end %>
<% foreach x as rit rowid y from 1 reverse in integers %>{<% separator %>,<% item %><%= x %> <%= y %><% end %>}<%empty%>-<% end %>

<% foreach x as it in integers %>{<% item %> <%= x %><% end %>}<%empty%>-<% end %>
<% foreach x as rit reverse in integers %>{<% item %> <%= x %><% end %>}<%empty%>-<% end %>
<% foreach x as it rowid y in integers %>{<% item %> <%= x %> <%= y %><% end %>}<%empty%>-<% end %>
<% foreach x as rit rowid y reverse in integers %>{<% item %> <%= x %> <%= y %><% end %>}<%empty%>-<% end %>
<% foreach x as it rowid y from 1 in integers %>{<% item %> <%= x %> <%= y %><% end %>}<%empty%>-<% end %>
<% foreach x as rit rowid y from 1 reverse in integers %>{<% item %> <%= x %> <%= y %><% end %>}<%empty%>-<% end %>

<% foreach x as it in integers %>{<% separator %>,<% item %><%= x %><% end %>}<% end %>
<% foreach x as rit reverse in integers %>{<% separator %>,<% item %><%= x %><% end %>}<% end %>
<% foreach x as it rowid y in integers %>{<% separator %>,<% item %><%= x %> <%= y %><% end %>}<% end %>
<% foreach x as rit rowid y reverse in integers %>{<% separator %>,<% item %><%= x %> <%= y %><% end %>}<% end %>
<% foreach x as it rowid y from 1 in integers %>{<% separator %>,<% item %><%= x %> <%= y %><% end %>}<% end %>
<% foreach x as rit rowid y from 1 reverse in integers %>{<% separator %>,<% item %><%= x %> <%= y %><% end %>}<% end %>

<% foreach x as it in integers %>{<% item %> <%= x %><% end %>}<% end %>
<% foreach x as rit reverse in integers %>{<% item %> <%= x %><% end %>}<% end %>
<% foreach x as it rowid y in integers %>{<% item %> <%= x %> <%= y %><% end %>}<% end %>
<% foreach x as rit rowid y reverse in integers %>{<% item %> <%= x %> <%= y %><% end %>}<% end %>
<% foreach x as it rowid y from 1 in integers %>{<% item %> <%= x %> <%= y %><% end %>}<% end %>
<% foreach x as rit rowid y from 1 reverse in integers %>{<% item %> <%= x %> <%= y %><% end %>}<% end %>
<% end %>
<% end view %>
<% view master_if uses data::master %>
<% template render() %>
<% if integer %>integer<%else%>!integer<% end %>
<% if not integer %>!integer<%else%>!!integer<% end %>
<% if empty text %>text empty<% else %>text not empty<% end %>
<% if not empty text %>!text empty<% else %>!!text not empty<% end %>
<% if (true) %>true<%end%>
<% if (false) %>false<%end%>
<% if (false) %>false<% elif (true) %>true<%end%>
<% end template %>
<% end view %>

<% view master_url uses data::master %>
<% template render () %>
<% url "." %>
<% url "." using integer %>
<% url "." using integer,text %>
<% url "/" using integer %>
<% url "/" using integer,text %>
<% url "/" using integer,text | raw %>
<% url "/foo" %>
<% end %>
<% end view %>

<% view gt_text uses data::master %>
<% template render() %>
<% gt "No text" %>
<% gt "It is text: {1}" using text %>
<% gt "Context", "No text" %>
<% gt "Context", "It is text: {1}" using text %>
<% ngt "I have 1 file in {2}", "I have {1} files in {2}", integer using integer, text %>
<% ngt "Context","I have 1 file in {2}", "I have {1} files in {2}", integer using integer, text %>
<% end template %>
<% end view %>

<% view master_block_filter uses data::master %>
<% template render () %>
<%= text %>|<% gt "{1}" using text %>|<% url "/" using text %>
<% filter jsescape %><%= text %>|<% gt "{1}" using text %>|<% url "/" using text %><% end %>
<% filter ext test_filter %><%= text %>|<% gt "{1}" using text %>|<% url "/" using text %>|<% filter jsescape %><%= text %><% end %>|<%= text %><% end %>
<%= text %>
<% end %>
<% end view %>


<% view master_filter uses data::master %>
<% template render() %>
<%= integer %>
<% gt "{1,w=3}" using integer %>
<% gt "{1,w=3} {2}" using integer , text %>
<% gt "{1}" using text | raw %>
<% gt "{1}" using text | ext test_filter %>
<% gt "{1}" using text | ext test_filter | escape %>
<% gt "{1} {2}" using text | ext test_filter | escape , integer %>
<%=text %>
<%=text | raw %>
<%=text | ext test_filter %>
<%=text | ext test_filter | escape %>
<%=text | urlencode %>
<%=text | base64_urlencode %>
<% end %>
<% end view %>

<% view form_test uses data::form_test %>
<% template render() %>
<% form as_p f %>
<% form input t1 %>
<% form input t2 %>
<% form begin t2 %> prop <% form end t2 %>
<% form block t2 %> id='x' <% end form %>
<% end template %>
<% end %>

<% view cache_test uses data::master %>
<% template render() %><% cache "key" for 2 on miss call() %><%= integer %><% trigger "tr" %><% end cache %><% end template %>
<% end %>
<% view cache_test_nr uses data::master %>
<% template render() %><% cache "key" for 2 no recording %><%= integer %><% trigger "tr" %><% end cache %><% end template %>
<% end %>
<% view cache_test_nt uses data::master %>
<% template render() %><% cache "key" for 2 no triggers %><%= integer %><% end cache %><% end template %>
<% end %>

<% view helper_helper uses data::helper %>
<% template show_x() %><%= x %><% c++ content.app(); %><% end %>
<% template show_y() %><%= y %><% end %>
<% template show_x(int z) %><%= x %>; <%= z %><% end %>
<% template show_y(int z) %><%= y %>; <%= z %><% end %>
<% template render() %>r <%=x %>; <%= y %><% end %>
<% end %>

<% view helper_master uses data::master %>
<% template show_integer() %>i <%= integer %><% end template %>
<% template render() %>ri <%= integer %><% end template %>
<% end view %>

<% view test_using uses data::master %>
<% template compilation() %>
<% render text %>
<% render text with h%>
<% render text,text %>
<% render text,text with h %>

<% render "text" %>
<% render "text" with h%>
<% render "text","text" %>
<% render "text","text" with h %>

<% render "text",text with h %>
<% render text,"text" with h %>
<% render "text",text %>
<% render text,"text" %>

<% render "text" ,text with h %>
<% render text ,"text" with h %>
<% render "text" ,text %>
<% render text ,"text" %>

<% render "text" , text with h %>
<% render text , "text" with h %>
<% render "text" , text %>
<% render text , "text" %>

<% render "text", text with h %>
<% render text, "text" with h %>
<% render "text", text %>
<% render text, "text" %>



<% end template %>
<% template render() %>
<% render "tc_skin", "helper_helper" with h %>
<% render "tc_skin", "helper_master" %>
<% render "helper_helper" with h %>
<% render text with h %>
<% render "helper_master" %>
<% using helper_helper with h as hlp %>
<% include show_x() from hlp %>
<% include show_y() from hlp %>
<% include show_x(h.y) from hlp %>
<% include show_y(h.x) from hlp %>
<% end using %>
<% using helper_master as hlp %>
<% include show_integer() from hlp %>
<% end using %>
<% include show_x() using helper_helper with h %>
<% include show_y() using helper_helper with h %>
<% include show_x(h.y) using helper_helper with h %>
<% include show_y(h.x) using helper_helper with h %>
<% include show_integer() using helper_master %>
<% end template %>
<% end view %>

<% view master_api uses data::master abstract inline %>
<% template m1() = 0 %>
<% end view %>

<% view master_api2 uses data::master abstract %>
<% template f1() %>f1-test<% end %>
<% template call() = 0 %>
<% end view %>


<% view helper_api uses data::helper abstract inline %>
<% template h1()=0%>
<% end view %>

<% view master_plugin uses data::master extends master_api %>
<% template m1() %>skin::master_plugin::m1 <%= text %><% end %>
<% end view %>

<% view helper_plugin uses data::helper extends helper_api %>
<% template h1() %>skin::helper_plugin::h1 <%= x %><% end %>
<% end view %>

<% view message_base uses data::master %>
<% template f1() %><% gt "translate me" %><% end %>
<% template render() %><% include f1() %><% end %>
<% end view %>

<% view test_master_plugin uses data::master %>
<% template render() %>
<% using master_api as m from "master_plugin" %><% include m1() from m %><% end using %>
<% using master_api as m from name1 %><% include m1() from m %><% end using %>
<% using master_api as m from "plugin","master_plugin" %><% include m1() from m %><% end using %>
<% using master_api as m from "plugin",name1 %><% include m1() from m %><% end using %>
<% using master_api as m from skin1,"master_plugin" %><% include m1() from m %><% end using %>
<% using master_api as m from skin1,name1 %><% include m1() from m %><% end using %>
<% using master_api2 as m from "plugin2","master_plugin" %><% include call() from m %><% end using %>
<% end template %>
<% end view %>

<% view test_helper_plugin uses data::master %>
<% template render() %>
<% using helper_api with h as m from "helper_plugin" %><% include h1() from m %><% end using %>
<% using helper_api with h as m from name1 %><% include h1() from m %><% end using %>
<% using helper_api with h as m from "plugin","helper_plugin" %><% include h1() from m %><% end using %>
<% using helper_api with h as m from "plugin",name1 %><% include h1() from m %><% end using %>
<% using helper_api with h as m from skin1,"helper_plugin" %><% include h1() from m %><% end using %>
<% using helper_api with h as m from skin1,name1 %><% include h1() from m %><% end using %>
<% end template %>
<% end view %>



<% end skin %>
