test/integration/zafu_compiler/roles.yml in zena-1.0.0.beta3 vs test/integration/zafu_compiler/roles.yml in zena-1.0.0.rc1

- old
+ new

@@ -7,41 +7,41 @@ tem: "simple text" res: "simple text" show_property_filter_vclass: - src: "<r:Letter do='paper'/>" - tem: "<% if @node.kpath_match?('NNL') -%><%= @node.prop['paper'] %><% end -%>" + src: "<r:Letter? do='paper'/>" + tem: "<% if @node.kpath_match?('NNL') %><%= @node.prop['paper'] %><% end %>" show_property_filter_role_no_role: - src: "<r:Original>Has an origin</r:Original>" + src: "<r:Original?>Has an origin</r:Original?>" res: '' show_property_filter_role_has_role: context: node: tree_jpg - src: "<r:Original>Has an original</r:Original>" - tem: "<% if @node.has_role?(493147733) -%>Has an original<% end -%>" + src: "<r:Original?>Has an original</r:Original?>" + tem: "<% if @node.has_role?(493147733) %>Has an original<% end %>" res: 'Has an original' show_bad_role: - src: "<r:Foo>abc</r:Foo>" + src: "<r:Foo?>abc</r:Foo?>" tem: "/Invalid role or class 'Foo'/" form_with_all_roles: context: node: tree_jpg src: | - <r:possible_roles> + <r:vclass do='roles'> <fieldset do='each'> <legend do='name'/> <ul do='columns'> <li do='each'><label do='name'/> <r:input/></li> </ul> </fieldset> - </r:possible_roles> - res: "/label.weight.*node\[weight\].*origin.*value='Big Bang'.*assigned/" + </r:vclass> + res: "/label.origin.*node\[origin\].*value='Big Bang'.*weight.*assigned/" show_all_properties: context: node: tree_jpg src: | @@ -51,6 +51,82 @@ <ul do='columns'> <li do='each' do='if' test='@node.send(name)'><label do='name'/> <r:eval>@node.send(name)</r:eval></li> </ul> </fieldset> </r:roles> - res: "/<label>origin</label> Big Bang</li>/" + res: "/<label>origin</label> Big Bang</li>/" + +vclass_name: + context: + node: letter + src: "<r:vclass do='name'/>" + tem: "<% var1 = @node.virtual_class %><%= var1.name %>" + res: "Letter" + +vclass_roles: + context: + node: letter + src: "<r:vclass do='roles' do='each' join=', '><r:name/> (<r:columns do='each' join=',' do='name'/>)</r:vclass>" + tem: "/var1 = @node\.virtual_class .* var2 = var1.sorted_roles/" + res: "Node (summary,text,title), Original (origin,tz,weight), Task (assigned), Letter (paper,search,search_mono)" + +vclass_column_size: + context: + node: letter + src: "<r:vclass do='roles' do='each' join=', '><r:name/> (<r:columns do='size'/>)</r:vclass>" + res: "Node (3), Original (3), Task (1), Letter (3)" + +vclass_context: + src: "<r:Image><r:name/></r:Image>" + tem: "<% if var1 = VirtualClass[\"Image\"] %><%= var1.name %><% end %>" + res: "Image" + +vclass_scope: + context: + node: bird_jpg + src: "<r:Image?>I am an image</r:Image?>" + tem: "<% if @node.kpath_match?('NDI') %>I am an image<% end %>" + res: "I am an image" + +vclass_in_rubyless: + src: "<b do='Contact.name'/>" + tem: "<b><%= (VirtualClass[\"Contact\"] ? VirtualClass[\"Contact\"].name : nil) %></b>" + res: "<b>Contact</b>" + +grid_manual: + src: | + <table do='images in site'> + <tr do='Image' do='roles'><th colspan='#{columns.size}' do='each' do='name'/></tr> + <tr do='Image' do='roles' do='each' do='columns'><th do='each' do='name'/></tr> + <tr do='each'><r:Image do='roles' do='each' do='columns'><td do='each' do='@node.send(name)'/></r:Image></tr> + </table> + res: "/<th colspan='3'>Node.*<th colspan='3'>Original.*<th>exif</th><th>height</th><th>width</th>.*<td>image/jpeg</td><td>jpg</td>/" + +grid: + src: "<r:images in='site' do='grid'/>" + res: "/<table class='grid'>.*<th class='role' colspan='3'>Node.*<th class='role' colspan='3'>Original.*<th>exif</th><th>height</th><th>width</th>.*<td>image/jpeg</td><td>jpg</td>/" + +list_relations: + src: "<r:Contact do='relations' do='each' join=', ' do='name'/>" + res: "collaborator_for, favorite, favorite_for, home_for, hot_for, icon, reference, reference_for, set_tag" + +list_relations_filter_group: + src: "<r:Contact do='relations(\"doc\")' do='each' join=', ' do='name'/>" + res: "reference, reference_for, set_tag" + +input_relation_name: + src: "<r:select name='rel' eval='Contact.relations(\"doc\").map(:name)'/>" + res: "<select name='node[rel]'><option value=\"reference\">reference</option>\n<option value=\"reference_for\">reference_for</option>\n<option value=\"set_tag\">set_tag</option></select>" + +manual_select: + src: "<select name='node[rel]' do='Contact.relations(\"doc\")'><option value='#{name}' do='each' do='eval'>trans(\"rel_#{name}\")</option></select>" + res: "<select name='node[rel]'><option value='reference'>rel_reference</option><option value='reference_for'>rel_reference_for</option><option value='set_tag'>rel_set_tag</option></select>" + +inspect_display_links: + src: | + <r:Template do='relations' do='each' set_rel='name' do='main'> + <h3 do='rel'/> + <ul do='query' default='nodes' select='#{rel}s'> + <li do='each' do='link'/> + </ul> + </r:Template> + tem: '/<h3><%= _zrel %></h3>/' \ No newline at end of file