equal
deleted
inserted
replaced
19 |
19 |
20 __authors__ = [ |
20 __authors__ = [ |
21 '"Sverre Rabbelier" <sverre@rabbelier.nl>', |
21 '"Sverre Rabbelier" <sverre@rabbelier.nl>', |
22 ] |
22 ] |
23 |
23 |
|
24 |
|
25 import operator |
24 |
26 |
25 from soc.views import out_of_band |
27 from soc.views import out_of_band |
26 from soc.views.helper import access |
28 from soc.views.helper import access |
27 |
29 |
28 import soc.cache.sidebar |
30 import soc.cache.sidebar |
54 menus = callback(id, user) |
56 menus = callback(id, user) |
55 |
57 |
56 for menu in (menus if menus else []): |
58 for menu in (menus if menus else []): |
57 sidebar.append(menu) |
59 sidebar.append(menu) |
58 |
60 |
59 return sidebar |
61 return sorted(sidebar, key=lambda x: x.get('group')) |
60 |
62 |
61 |
63 |
62 def getSidebarItems(params): |
64 def getSidebarItems(params): |
63 """Retrieves a list of sidebar entries for this view. |
65 """Retrieves a list of sidebar entries for this view. |
64 |
66 |
173 if 'sidebar_heading' not in params: |
175 if 'sidebar_heading' not in params: |
174 params['sidebar_heading'] = params['name'] |
176 params['sidebar_heading'] = params['name'] |
175 |
177 |
176 menu['heading'] = params['sidebar_heading'] |
178 menu['heading'] = params['sidebar_heading'] |
177 menu['items'] = submenus |
179 menu['items'] = submenus |
|
180 menu['group'] = params['sidebar_grouping'] |
178 |
181 |
179 menus = [menu] |
182 menus = [menu] |
180 |
183 |
181 return menus |
184 return menus |