Added manage redirect.
authorLennard de Rijk <ljvderijk@gmail.com>
Thu, 29 Jan 2009 18:10:21 +0000
changeset 1065 b661dc8ffd5f
parent 1064 4f1d179f39ae
child 1066 b22750a2b04a
Added manage redirect. Also changed the menu layout for group entities. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed
app/soc/views/helper/redirects.py
app/soc/views/models/group.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.
   """
--- 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)