[jifty-devel] menu patch
bart at urnet.com.au
bart at urnet.com.au
Tue Jul 4 00:08:31 EDT 2006
Hi,
This is a patch to _elements/menu to use the render_as_menu sub rather
than do it all by hand.
Can someone check this for visual stile, works for me with a screen
reader but who knows what it looks like :).
Bart
Index: jifty/trunk/share/web/templates/_elements/menu
===================================================================
--- jifty/trunk/share/web/templates/_elements/menu (revision 1469)
+++ jifty/trunk/share/web/templates/_elements/menu (working copy)
@@ -5,30 +5,5 @@
# Default to the app menu
$menu = Jifty->web->navigation if not defined $menu;
</%init>
-% my @children = $menu->children;
-% if ( @children ) {
-<ul class="menu">
-<%perl>
-$m->comp( ".menu", item => $_ )
- for sort { $a->sort_order <=> $b->sort_order }
- @children;
-</%perl>
-</ul>
-% }
-<%def .menu>
- <%args>
- $item
- </%args>
- <%init>
- my @kids = $item->children;
- </%init>
- <li <% $item->active ? 'class="active"' : '' |n %>><% $item->as_link |n %><% @kids ? '' : '</li>' |n %>
-% if (@kids) {
- <ul class="submenu">
-% $m->comp(".menu", item => $_) for @kids;
- </ul>
- </li>
-% }
-</%def>
-
+% $menu->render_as_menu;
More information about the jifty-devel
mailing list