Created
February 11, 2011 01:55
-
-
Save dr-kd/821783 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[%- MACRO render_submenu(node) BLOCK -%] | |
[%- FOREACH item IN node.getAllChildren -%] | |
-[% NEXT IF item.getNodeValue == "descr.txt" %] | |
+[% NEXT IF item.getNodeValue == 0 %] | |
<li> [% print_metadata(node) %] | |
-[% IF item.getAllChildren.size %] <ul> [% render_submenu(item) %] </ul> [% END %] </li> | |
-[%- END -%] | |
+[% IF item.getAllChildren.size %] <ul> [% render_submenu(item) %] </ul> | |
+[% ELSIF item.getNodeValue !=0 %] <li> [% render_node(item) %] [% END %] | |
+[% END %] </li> | |
[%- END -%] | |
</ul> | |
[% MACRO print_metadata(node) BLOCK -%] | |
[% FOREACH i IN item.getAllChildren %] | |
-<li id="[% i.getNodeValue() %]"><h3>[% i.getMetaDataFor('description') %]</h3> | |
-<form action="[% c.uri_for(annotate_code, i.getNodeValue()) %]" method="get"> | |
+[% render_node(i) %] | |
+</li> | |
+[% END %] | |
+[% END %] | |
+ | |
+[% MACRO render_node(x) BLOCK %] | |
+<li id="[% x.getNodeValue() %]"><h3>[% x.getMetaDataFor('description') %] </h3> ([% x.getNodeValue() %]). | |
+<form action="[% c.uri_for(annotate_code, x.getNodeValue()) %]" method="get"> | |
[% FOREACH group IN groups; SET row = loop.index %] | |
[% FOREACH g IN group %] | |
<input type="checkbox" name="[% row %]" value="[% g %]">[% g %]</input> | |
[% END %] | |
<br> | |
[% END %] | |
-<input type="submit" value="Annotate '[% i.getMetaDataFor('description') %]'"> | |
+<input type="submit" value="Annotate '[% x.getMetaDataFor('description') %]'"> | |
</form> | |
-</li> | |
[% END %] | |
-[% END %] | |
- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment