Added redirect for use in Surveys.
authorDaniel Diniz <ajaksu@gmail.com>
Sun, 28 Jun 2009 14:45:08 +0200
changeset 2434 f6d45459b6b4
parent 2433 0ba41e115dbc
child 2435 dd16e9b3c2d0
Added redirect for use in Surveys. Also some minor style changes. Patch by: Daniel Diniz Reviewed by: Lennard de Rijk
app/soc/views/helper/redirects.py
--- a/app/soc/views/helper/redirects.py	Sun Jun 28 14:40:55 2009 +0200
+++ b/app/soc/views/helper/redirects.py	Sun Jun 28 14:45:08 2009 +0200
@@ -110,15 +110,17 @@
   return '/%s/home/%s' % (
       params['url_name'], entity.key().id_or_name())
 
+
 def getReviewRedirect(entity, params):
   """Returns the redirect to review the specified entity.
   """
-  
+
   return '/%s/review/%s' % (
       params['url_name'], entity.key().id_or_name())
 
+
 def getReviewOverviewRedirect(entity, params):
-  """Returns the redirect to the review_overview using the 
+  """Returns the redirect to the review_overview using the
      keyname of the specified entity.
   """
 
@@ -345,6 +347,27 @@
   return '/document/list/%s/%s' % (prefix, entity.key().id_or_name())
 
 
+def getCreateSurveyRedirect(entity, prefix):
+  """Returns the redirect for new documents.
+  """
+
+  return '/survey/create/%s/%s' % (prefix, entity.key().id_or_name())
+
+
+def getListSurveysRedirect(entity, prefix):
+  """Returns the redirect for listing documents.
+  """
+
+  return '/survey/list/%s/%s' % (prefix, entity.key().id_or_name())
+
+
+def getListSurveyResultsRedirect(entity, prefix):
+  """Returns the redirect for listing documents.
+  """
+
+  return '/survey/list_results/%s/%s' % (prefix, entity.key().id_or_name())
+
+
 def getToSRedirect(presence):
   """Returns link to 'show' the ToS Document if it exists, None otherwise.