# HG changeset patch # User Lennard de Rijk # Date 1233252621 0 # Node ID b661dc8ffd5f56831fc37c295a8c7221d26f0ae5 # Parent 4f1d179f39ae675db9ec0437c716718d51aa4db5 Added manage redirect. Also changed the menu layout for group entities. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed diff -r 4f1d179f39ae -r b661dc8ffd5f app/soc/views/helper/redirects.py --- a/app/soc/views/helper/redirects.py Thu Jan 29 16:12:57 2009 +0000 +++ b/app/soc/views/helper/redirects.py Thu Jan 29 18:10:21 2009 +0000 @@ -147,6 +147,16 @@ return result +def getManageRedirect(entity, params): + """Returns the redirect for managing the given entity. + """ + + result = '/%s/manage/%s' % ( + params['url_name'], entity.key().name()) + + return result + + def getSelectRedirect(entity, params): """Returns the pick redirect for the specified entity. """ diff -r 4f1d179f39ae -r b661dc8ffd5f app/soc/views/models/group.py --- a/app/soc/views/models/group.py Thu Jan 29 16:12:57 2009 +0000 +++ b/app/soc/views/models/group.py Thu Jan 29 18:10:21 2009 +0000 @@ -228,8 +228,7 @@ # create the list parameters list_params = role_views[role_name].getParams().copy() - # TODO(ljvderijk) define the list redirect action to the managing page - list_params['list_action'] = (redirects.getEditRedirect, list_params) + list_params['list_action'] = (redirects.getManageRedirect, list_params) list_params['list_description'] = ugettext( "An overview of the %s for this %s." % ( list_params['name_plural'], params['name'])) @@ -326,8 +325,7 @@ group_entity = role_description['group'] # set the menu header name - menu['heading'] = '%s %s' %(params['name'], - group_entity.short_name) + menu['heading'] = group_entity.short_name # get the documents for this group entity doc_items = document_view.view.getMenusForScope(group_entity, params) @@ -341,7 +339,7 @@ # add the items together menu['items'] = doc_items + group_items - menu['group'] = 'Clubs' + menu['group'] = params['name_plural'] # append this as a new menu menus.append(menu)