app/soc/views/sitemap/sidebar.py
changeset 1024 2a0ae6483825
parent 1017 6ad4fdb48840
child 1307 091a21cf3627
--- a/app/soc/views/sitemap/sidebar.py	Wed Jan 28 02:25:51 2009 +0000
+++ b/app/soc/views/sitemap/sidebar.py	Wed Jan 28 02:27:25 2009 +0000
@@ -22,6 +22,8 @@
   ]
 
 
+import operator
+
 from soc.views import out_of_band
 from soc.views.helper import access
 
@@ -56,7 +58,7 @@
     for menu in (menus if menus else []):
       sidebar.append(menu)
 
-  return sidebar
+  return sorted(sidebar, key=lambda x: x.get('group'))
 
 
 def getSidebarItems(params):
@@ -175,6 +177,7 @@
 
   menu['heading'] = params['sidebar_heading']
   menu['items'] = submenus
+  menu['group'] = params['sidebar_grouping']
 
   menus = [menu]