app/soc/views/models/group.py
changeset 1065 b661dc8ffd5f
parent 1060 eb6231138307
child 1075 4fd9b11fba56
equal deleted inserted replaced
1064:4f1d179f39ae 1065:b661dc8ffd5f
   226     # for each role we create a separate list
   226     # for each role we create a separate list
   227     for role_name in role_views.keys():
   227     for role_name in role_views.keys():
   228       # create the list parameters
   228       # create the list parameters
   229       list_params = role_views[role_name].getParams().copy()
   229       list_params = role_views[role_name].getParams().copy()
   230 
   230 
   231       # TODO(ljvderijk) define the list redirect action to the managing page
   231       list_params['list_action'] = (redirects.getManageRedirect, list_params)
   232       list_params['list_action'] = (redirects.getEditRedirect, list_params)
       
   233       list_params['list_description'] = ugettext(
   232       list_params['list_description'] = ugettext(
   234           "An overview of the %s for this %s." % (
   233           "An overview of the %s for this %s." % (
   235           list_params['name_plural'], params['name']))
   234           list_params['name_plural'], params['name']))
   236     
   235     
   237       new_list_content = list_helper.getListContent(
   236       new_list_content = list_helper.getListContent(
   324 
   323 
   325       # get the group for this role description
   324       # get the group for this role description
   326       group_entity = role_description['group']
   325       group_entity = role_description['group']
   327 
   326 
   328       # set the menu header name
   327       # set the menu header name
   329       menu['heading'] = '%s %s' %(params['name'], 
   328       menu['heading'] = group_entity.short_name
   330           group_entity.short_name)
       
   331 
   329 
   332       # get the documents for this group entity
   330       # get the documents for this group entity
   333       doc_items = document_view.view.getMenusForScope(group_entity, params)
   331       doc_items = document_view.view.getMenusForScope(group_entity, params)
   334       doc_items = sidebar.getSidebarMenu(id, user, doc_items,
   332       doc_items = sidebar.getSidebarMenu(id, user, doc_items,
   335                                          params=doc_params)
   333                                          params=doc_params)
   339       group_items = sidebar.getSidebarMenu(id, user, group_items,
   337       group_items = sidebar.getSidebarMenu(id, user, group_items,
   340                                            params=self._params)
   338                                            params=self._params)
   341 
   339 
   342       # add the items together
   340       # add the items together
   343       menu['items'] = doc_items + group_items
   341       menu['items'] = doc_items + group_items
   344       menu['group'] = 'Clubs'
   342       menu['group'] = params['name_plural']
   345 
   343 
   346       # append this as a new menu
   344       # append this as a new menu
   347       menus.append(menu)
   345       menus.append(menu)
   348 
   346 
   349     return menus
   347     return menus