default:
context:
lang: 'en'
visitor: 'ant'
node: 'status'
src: "simple text"
tem: "simple text"
res: "simple text"
class_conditional:
old_src: ""
src: ""
tem: "/@node.kpath_match\?\('NDI'\)/"
class_conditional_in_if:
src: "imagenot an image"
tem: "<% if var1 = @node.parent %><% if var1.kpath_match?('NDI') %>image<% elsif true %>not an image<% end %><% end %>"
res: "not an image"
class_conditional_in_array:
src: ""
tem: "/Cannot scope class in list .use each before filtering./"
case_when:
src: "this is a documentPagePub"
tem: "<% if false %><% elsif @node.kpath_match?('ND') %>this is a document<% elsif @node.kpath_match?('NP') %>Page<% elsif (@node.version.status==50) %>Pub<% end %>"
res: "Page"
case_when_else:
src: "DocumentNot a document"
res: "Not a document"
case_when_else_text:
src: "Document"
res: "Not a document"
case_when_test:
src: "onetwo"
res: "one"
if_html_tag:
src: "
yes it's truefour
"
res: "yes it's true
"
if_html_tag_false:
src: "yes it's truefour
"
res: "four
"
if_html_tag_false_html_params:
src: "yes it's truefour
"
res: "four
"
if_html_tag_elsif:
src: "ABC
"
tem: '<% if (2==1) %>A
<% elsif 1 %>B
<% elsif true %>C
<% end %>'
res: "B
"
case_when_html_tag:
src: "onetwofour
"
res: "two
"
case_when_html_tag_else:
src: "onetwofour
"
res: "four
"
case_when_test_attribute:
src: "onetwo"
res: "one"
case_when_evil_test:
src: "onetwothree"
tem: "/'lasgn' not available in RubyLess./"
res: "three"
if_test_equal:
src: "one"
res: "one"
if_test_param:
context:
f: '3'
src: "three / exist"
tem: "<% if (params[:f]==\"3\") %>three<% end %> / <% if not params[:f].blank? %>exist<% end %>"
res: 'three / exist'
if_in_if:
src: "strange...wrong!other node"
tem: "<% if (@node.zip==22) %><% if (1==2) %>strange...<% elsif true %>wrong!<% end %><% elsif true %>other node<% end %>"
res: "wrong!"
do_if:
src: "it's trueit's false"
res: "it's false"
if_has_discussion:
src: ":yesno :yesno"
res: "status title:yes zena enhancements:no"
case_ancestor:
src: ""
res: "Collections, Kill the bugs, Nature, people, projects list, Skins (layout themes)"
on_if_ancestor_no_class:
old_src: ""
src: ""
tem: '/var3.is_ancestor\?\(@node\)/'
res: "Collections, Kill the bugs, Nature, people, projects list, Skins (layout themes)"
multiple_class_conditions:
src: "Agrippina"
tem: "/class='unknown<%= .*@node.custom_a==1.* \? ' one' : '' %><%= .*@node.custom_a==2.* \? ' two' : '' %>'/"
res: "Agrippina"
multiple_class_conditions_true_in_middle:
src: "Agrippina"
res: "Agrippina"
# var1 = stored 'papa'
test_ancestor_with_stored:
src: ""
tem: "/_zpapa = var1.*\(_zpapa\.is_ancestor\?\(var4\)\)/"
res: "a wiki with Zena
Clean Water project
"
on_if_kind_of:
context:
node: 'opening'
src: ""
res: "parc opening"
on_if_attribute:
src: ""
tem: "/var2.prop\['assigned'\]. \? ' on'/"
res: "a wiki with Zena
Clean Water project
Zena the wild CMS
"
on_if_attribute_with_edit:
src: "
"
tem: "/var2.prop\['assigned'\]. \? ' on'/"
on_if_node_main:
src: "hello
"
res: "crocodiles
status title
"
if_in_tag:
src: "done."
res: "/status title
.*done./"
if_in_tag_else:
src: "in formnot in form"
res: "not in form"
if_or:
src: "hello"
tem: "/<% if @node.can_write? \|\| !@node.version.prop[\"foo\"].blank? %>hello<% end %>|<% if !@node.version.prop[\"foo\"].blank? || @node.can_write? %>hello<% end %>/"
res: "hello"
if_or_same:
src: "hello"
tem: "/<% if !@node.version.prop[\"foo\"].blank? \|\| !@node.version.prop[\"text\"].blank? %>hello<% end %>|<% if !@node.version.prop[\"bar\"].blank? || !@node.version.prop[\"foo\"].blank? %>hello<% end %>/"
res: "hello"
if_now:
src: "futurepast"
tem: "<% if (@node.log_at ? (@node.log_at>Time.now) : nil) %>future<% elsif true %>past<% end %>"
res: "past"
on_if_now:
src: ""
tem: "/@node.log_at>Time.now.*' on'/"
res: "status title
"
visitor_is_anon:
context:
visitor: 'anon'
src: "anonymouslogged in"
res: "anonymous"
render_test:
src: "hello"
tem: "<% if @node.can_write? %>hello<% end %>"
do_complex_clause:
src: "futurepast
"
tem: "<% if (@node.log_at ? (@node.log_at>Time.now) : nil) %>future
<% elsif true %>past
<% end %>"
res: "past
"